This commit is contained in:
gorhill 2015-03-13 07:51:57 -04:00
parent f6fe56fc36
commit 6dd4a244fc
1 changed files with 7 additions and 12 deletions

View File

@ -160,6 +160,13 @@ var onBeforeBehindTheSceneRequest = function(details) {
pageStore.requestHostname = details.hostname;
pageStore.requestType = details.type;
// https://github.com/gorhill/uBlock/issues/1001
// Never block request for root document.
if ( details.type === 'main_frame' && details.parentFrameId === -1 ) {
pageStore.logRequest(pageStore, '');
return;
}
// Blocking behind-the-scene requests can break a lot of stuff: prevent
// browser updates, prevent extension updates, prevent extensions from
// working properly, etc.
@ -260,18 +267,6 @@ var onHeadersReceived = function(details) {
/******************************************************************************/
var headerStartsWith = function(headers, prefix) {
var i = headers.length;
while ( i-- ) {
if ( headers[i].name.toLowerCase().lastIndexOf(prefix, 0) === 0 ) {
return headers[i].value;
}
}
return '';
};
/******************************************************************************/
vAPI.net.onBeforeRequest = {
urls: [
'http://*/*',