File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 390390
391391 const wantsTemp = forcedTemp || checked . includes ( "temp" ) ;
392392 if ( ! contextMatch ) {
393- const isDefault = perms === ns . policy . DEFAULT ;
393+ const isDefault = perms === policy . DEFAULT ;
394394 perms = perms . clone ( ) ;
395395 if ( isDefault ) perms . temp = wantsTemp ;
396396 policy . set ( key , perms ) ;
Original file line number Diff line number Diff line change @@ -184,8 +184,10 @@ var TabGuard = (() => {
184184
185185 // we suspect tabs which 1) have not been removed/discarded, 2) are restricted by policy, 3) can run JavaScript
186186 let suspiciousTabs = [ ...ties ] . map ( TabCache . get ) . filter (
187- tab => tab && ! tab . discarded && ns . isEnforced ( tab . id ) &&
188- ( ! ( tab . _isExplicitOrigin = tab . _isExplicitOrigin || / ^ (?: h t t p s ? | f t p s ? | f i l e ) : / . test ( tab . url ) ) || ns . policy . can ( tab . url , "script" ) )
187+ tab => tab && ! tab . discarded && ns . isEnforced ( tab . id ) && (
188+ ! ( tab . _isExplicitOrigin = tab . _isExplicitOrigin || / ^ (?: h t t p s ? | f t p s ? | f i l e ) : / . test ( tab . url ) ) ||
189+ ns . getPolicy ( tab . cookieStoreId ) . can ( tab . url , "script" )
190+ )
189191 ) ;
190192
191193 return suspiciousTabs . length > 0 && ( async ( ) => {
@@ -222,7 +224,7 @@ var TabGuard = (() => {
222224 }
223225 if ( tab . url !== "about:blank" ) {
224226 debug ( `Real origin for ${ tab . _externalUrl } (tab ${ tab . id } ) is ${ tab . url } .` ) ;
225- if ( ! ns . policy . can ( tab . url , "script" ) ) return ;
227+ if ( ! ns . getPolicy ( tab . cookieStoreId ) . can ( tab . url , "script" ) ) return ;
226228 }
227229 }
228230 if ( ! tab . _contentType ) {
Original file line number Diff line number Diff line change 339339 return tab ?. url || documentUrl || url ;
340340 } ,
341341 requestCan ( request , capability ) {
342- return ! this . isEnforced ( request . tabId ) || this . policy . can ( request . url , capability , this . policyContext ( request ) ) ;
342+ return (
343+ ! this . isEnforced ( request . tabId ) ||
344+ ns . getPolicy ( request . cookieStoreId ) . can ( request . url , capability , this . policyContext ( request ) )
345+ ) ;
343346 } ,
344347
345348 getPolicy ( cookieStoreId ) {
Original file line number Diff line number Diff line change @@ -1139,7 +1139,7 @@ var UI = (() => {
11391139 }
11401140
11411141 _customOrAuto ( row ) {
1142- const { policy } = UI ;
1142+ const policy = this . policy ;
11431143 const { perms, contextMatch, siteMatch } = row ;
11441144 const isAuto = policy . autoAllowTop && perms . temp &&
11451145 contextMatch == siteMatch &&
@@ -1363,7 +1363,7 @@ var UI = (() => {
13631363 w . title = title ;
13641364 w . textContent &&= label ;
13651365 }
1366- row . _customPerms = perms = UI . policy . cascade ( this . policy . DEFAULT , this . mainUrl , { permissions : true } ) ;
1366+ row . _customPerms = perms = this . policy . cascade ( this . policy . DEFAULT , this . mainUrl , { permissions : true } ) ;
13671367 }
13681368 preset . classList . toggle ( "canScript" , perms . capabilities . has ( "script" ) ) ;
13691369 }
You can’t perform that action at this time.
0 commit comments