@@ -102,7 +102,7 @@ var Settings = {
102102 ns . defaults . local . isTorBrowser = true ; // prevents reset from forgetting
103103 ns . defaults . sync . cascadeRestrictions = true ; // we want this to be the default even on reset
104104 Sites . onionSecure = true ;
105-
105+ ns . local . torBrowserPolicy = policy ; // save for reset
106106 if ( ! this . gotTorBrowserInit ) {
107107 // First initialization message from the Tor Browser
108108 this . gotTorBrowserInit = true ;
@@ -111,13 +111,14 @@ var Settings = {
111111 // copying the Security Level preset on startup (only).
112112 // Manually changing the security level works as usual.
113113 ns . local . isTorBrowser = true ;
114- await ns . save ( ns . local ) ;
114+ await Promise . all ( [ ns . saveSession ( ) , ns . save ( ns . local ) ] ) ;
115+ this . reloadOptionsUI ( ) ;
115116 return ;
116117 }
117- } else {
118- reloadOptionsUI = true ;
119118 }
120119
120+ reloadOptionsUI = true ;
121+
121122 if ( policy && policy . TRUSTED ) {
122123 // Gracefully handle "new" capabilities still unknown to our settings host
123124 const knownCapabilities = settingsHost && settingsHost . knownCapabilities
@@ -151,13 +152,9 @@ var Settings = {
151152 }
152153
153154 if ( settings . sync === null ) {
154- // user is resetting options
155- policy = this . createDefaultDryPolicy ( ) ;
156-
157- // overriden defaults when user manually resets options
158-
159- // we want the reset options to stick (otherwise it gets very confusing)
160- ns . defaults . sync . overrideTorBrowserPolicy = true ;
155+ // User is resetting options:
156+ // pick either current Tor Browser Security Level or default NoScript policy
157+ policy = ns . local . torBrowserPolicy || this . createDefaultDryPolicy ( ) ;
161158 reloadOptionsUI = true ;
162159 }
163160
0 commit comments