@@ -944,8 +944,13 @@ window._gBrowser = {
944944 if ( securityUI ) {
945945 // Include the true final argument to indicate that this event is
946946 // simulated (instead of being observed by the webProgressListener).
947+ // Note: check state first to make sure the security UI object updates its
948+ // state from the docshell correctly.
949+ let state = securityUI . state ;
950+ let oldState = securityUI . oldState ;
947951 this . _callProgressListeners ( null , "onSecurityChange" ,
948- [ webProgress , null , securityUI . state , true ] ,
952+ [ webProgress , null , oldState , state ,
953+ securityUI . contentBlockingLogJSON , true ] ,
949954 true , false ) ;
950955 }
951956
@@ -1667,12 +1672,17 @@ window._gBrowser = {
16671672
16681673 // Restore the securityUI state.
16691674 let securityUI = aBrowser . securityUI ;
1675+ // Make sure to call the state getter before the oldState getter to give
1676+ // the securityUI object a chance to sync its state with the docshell
16701677 let state = securityUI ? securityUI . state :
16711678 Ci . nsIWebProgressListener . STATE_IS_INSECURE ;
1679+ let oldState = securityUI ? securityUI . oldState :
1680+ Ci . nsIWebProgressListener . STATE_IS_INSECURE ;
16721681 // Include the true final argument to indicate that this event is
16731682 // simulated (instead of being observed by the webProgressListener).
16741683 this . _callProgressListeners ( aBrowser , "onSecurityChange" ,
1675- [ aBrowser . webProgress , null , state , true ] ,
1684+ [ aBrowser . webProgress , null , oldState , state ,
1685+ securityUI . contentBlockingLogJSON , true ] ,
16761686 true , false ) ;
16771687
16781688 if ( aShouldBeRemote ) {
@@ -5062,9 +5072,10 @@ class TabProgressListener {
50625072 this . mMessage = aMessage ;
50635073 }
50645074
5065- onSecurityChange ( aWebProgress , aRequest , aState ) {
5075+ onSecurityChange ( aWebProgress , aRequest , aOldState , aState , aContentBlockingLogJSON ) {
50665076 this . _callProgressListeners ( "onSecurityChange" ,
5067- [ aWebProgress , aRequest , aState ] ) ;
5077+ [ aWebProgress , aRequest , aOldState , aState ,
5078+ aContentBlockingLogJSON ] ) ;
50685079 }
50695080
50705081 onRefreshAttempted ( aWebProgress , aURI , aDelay , aSameURI ) {
0 commit comments