mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-02 00:42:45 +01:00
fix #1735
This commit is contained in:
parent
aac6c091c2
commit
08dd67b854
@ -391,11 +391,15 @@ housekeep itself.
|
|||||||
return tabContexts[vAPI.noTabId];
|
return tabContexts[vAPI.noTabId];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// https://github.com/gorhill/uBlock/issues/1735
|
||||||
|
// Always push before committing, to allow popup detector code to do its
|
||||||
|
// job.
|
||||||
var commit = function(tabId, url) {
|
var commit = function(tabId, url) {
|
||||||
var entry = tabContexts[tabId];
|
var entry = tabContexts[tabId];
|
||||||
if ( entry === undefined ) {
|
if ( entry === undefined ) {
|
||||||
entry = push(tabId, url);
|
entry = push(tabId, url);
|
||||||
} else {
|
} else {
|
||||||
|
entry.push(url);
|
||||||
entry.commit(url);
|
entry.commit(url);
|
||||||
}
|
}
|
||||||
return entry;
|
return entry;
|
||||||
@ -534,8 +538,6 @@ vAPI.tabs.onClosed = function(tabId) {
|
|||||||
// d: close target
|
// d: close target
|
||||||
|
|
||||||
vAPI.tabs.onPopupUpdated = (function() {
|
vAPI.tabs.onPopupUpdated = (function() {
|
||||||
//console.debug('vAPI.tabs.onPopup: details = %o', details);
|
|
||||||
|
|
||||||
// The same context object will be reused everytime. This also allows to
|
// The same context object will be reused everytime. This also allows to
|
||||||
// remember whether a popup or popunder was matched.
|
// remember whether a popup or popunder was matched.
|
||||||
var context = {};
|
var context = {};
|
||||||
@ -575,9 +577,15 @@ vAPI.tabs.onPopupUpdated = (function() {
|
|||||||
context.requestType = 'popup';
|
context.requestType = 'popup';
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764
|
// https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764
|
||||||
// Ignore bad target URL. On Firefox, an `about:blank` tab may be
|
// Ignore bad target URL. On Firefox, an `about:blank` tab may be
|
||||||
// opened for a new tab before it is filled in with the real target URL.
|
// opened for a new tab before it is filled in with the real target
|
||||||
if ( context.requestHostname === '' ) {
|
// URL.
|
||||||
|
// https://github.com/gorhill/uBlock/issues/1735
|
||||||
|
// Do not bail out on `data:` URI, they are commonly used for popups.
|
||||||
|
if (
|
||||||
|
context.requestHostname === '' &&
|
||||||
|
targetURL.startsWith('data:') === false
|
||||||
|
) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user