1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-26 12:22:50 +01:00
This commit is contained in:
gorhill 2015-08-29 18:35:08 -04:00
parent cf9869877d
commit 583daddbf8
2 changed files with 10 additions and 1 deletions

View File

@ -205,6 +205,8 @@ const contentObserver = {
url: location.spec
};
//console.log('shouldLoad: type=' + type' ' + 'url=' + location.spec);
if ( typeof messageManager.sendRpcMessage === 'function' ) {
// https://bugzil.la/1092216
messageManager.sendRpcMessage(this.cpMessageName, details);

View File

@ -1752,10 +1752,10 @@ var httpObserver = {
//console.log('http-on-opening-request:', URI.spec);
var pendingRequest = this.lookupPendingRequest(URI.spec);
var rawtype = channel.loadInfo && channel.loadInfo.contentPolicyType || 1;
// Behind-the-scene request
if ( pendingRequest === null ) {
var rawtype = channel.loadInfo && channel.loadInfo.contentPolicyType || 1;
if ( this.handleRequest(channel, URI, { tabId: vAPI.noTabId, rawtype: rawtype }) ) {
return;
}
@ -1768,6 +1768,13 @@ var httpObserver = {
return;
}
// https://github.com/gorhill/uBlock/issues/654
// Use the request type from the HTTP observer point of view, it's most
// likely the most accurate.
if ( rawtype !== 1 ) {
pendingRequest.rawtype = rawtype;
}
if ( this.handleRequest(channel, URI, pendingRequest) ) {
return;
}