1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

Firefox: observe main_frame requests too

This commit is contained in:
Deathamns 2014-12-16 16:35:14 +01:00
parent 892e2fe45a
commit ec69a50101
2 changed files with 6 additions and 3 deletions

View File

@ -84,11 +84,13 @@ let contentPolicy = {
);
},
shouldLoad: function(type, location, origin, context) {
if (type === 6 || !context || !/^https?$/.test(location.scheme)) {
if (!context || !/^https?$/.test(location.scheme)) {
return this.ACCEPT;
}
let win = (context.ownerDocument || context).defaultView;
let win = type === 6
? context.contentWindow
: (context.ownerDocument || context).defaultView;
if (!win) {
return this.ACCEPT;
@ -98,7 +100,7 @@ let contentPolicy = {
url: location.spec,
type: type,
tabId: -1,
frameId: win === win.top ? 0 : 1,
frameId: type === 6 ? -1 : (win === win.top ? 0 : 1),
parentFrameId: win === win.top ? -1 : 0
})[0];

View File

@ -832,6 +832,7 @@ vAPI.net.registerListeners = function() {
3: 'image',
4: 'stylesheet',
5: 'object',
6: 'main_frame',
7: 'sub_frame',
11: 'xmlhttprequest'
};