ChannelClassifierService notifies "urlclassifier-before-block-channel"
event when a channel is going to be blocked by protection features.
It also provides an API for receivers to "unblock" the channel.
Sample usage:
this.service = Cc["@mozilla.org/url-classifier/channel-classifier-service;1"].getService(
Ci.nsIChannelClassifierService
);
if (this.service) {
this.service.addListener({
observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "urlclassifier-before-block-channel":
let channel = aSubject.QueryInterface(Ci.nsIUrlClassifierBlockedChannel);
channel.unblock();
break;
}
},
})
}
Differential Revision: https://phabricator.services.mozilla.com/D76836
There's no use case for stateful comparators, so they can be just plain
function pointers.
This is used in some hot places like CSS selector matching.
Differential Revision: https://phabricator.services.mozilla.com/D77084
The response from ServiceWorker might also be COOP mismatched, such that the document/sub-document loading need to be performed on another process.
However, DocumentLoadListener only works with nsHttpChannel.
This patch would like to support InterceptedHttpChannel in DocumentLoadListener.
Differential Revision: https://phabricator.services.mozilla.com/D76841
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.
I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.
Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.
Differential Revision: https://phabricator.services.mozilla.com/D75447
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.
I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.
Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.
Differential Revision: https://phabricator.services.mozilla.com/D75447
This was a bit of pain to track down, because some code was allowing an ID of 0, and creating a request context to match, but other code was treating 0 as invalid.
Differential Revision: https://phabricator.services.mozilla.com/D76652
This drops `followLinks` as 1) it has been no-op on UNIX for a long time and 2) its Windows implementation never had a proper symlink support.
Differential Revision: https://phabricator.services.mozilla.com/D75569
This patch removes the assertion that ensures the channel is
top-level via BrowsingContext.
This is because more than one testcases creates a TYPE_DOCUMENT channel
to test.
Differential Revision: https://phabricator.services.mozilla.com/D76152
The previous patch stops us from firing the load event if we abort a load. We have a few crashtests that abort loads (either by directly calling stop(), or by starting a new navigation before load completes).
This switches the reftest harness to use web progress to determine when we've finished loading a test.
Differential Revision: https://phabricator.services.mozilla.com/D73995
We don't need to call this API in DocumentLoadListener::AsyncOpen because we have
already called this in nsHttpChannel::AsyncOpen
Differential Revision: https://phabricator.services.mozilla.com/D76275
This drops `followLinks` as 1) it has been no-op on UNIX for a long time and 2) its Windows implementation never had a proper symlink support.
Differential Revision: https://phabricator.services.mozilla.com/D75569
This patch removes TYPE_DOCUMENT test in test_shouldclassify because the
testcase creates a non-top level channel with TYPE_DOCUMENT flag (this is wong!),
which triggers the assertion in UpdateIsOnContentBlockingAllowList.
File a follow-up bug 1640715 to add TYPE_DOCUMENT test back.
Differential Revision: https://phabricator.services.mozilla.com/D76152
We don't need to call this API in DocumentLoadListener::AsyncOpen because we have
already called this in nsHttpChannel::AsyncOpen
Differential Revision: https://phabricator.services.mozilla.com/D76275