Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 13, 2016
1 parent aac6c09 commit 08dd67b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/js/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,15 @@ housekeep itself.
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 entry = tabContexts[tabId];
if ( entry === undefined ) {
entry = push(tabId, url);
} else {
entry.push(url);
entry.commit(url);
}
return entry;
Expand Down Expand Up @@ -534,8 +538,6 @@ vAPI.tabs.onClosed = function(tabId) {
// d: close target

vAPI.tabs.onPopupUpdated = (function() {
//console.debug('vAPI.tabs.onPopup: details = %o', details);

// The same context object will be reused everytime. This also allows to
// remember whether a popup or popunder was matched.
var context = {};
Expand Down Expand Up @@ -575,9 +577,15 @@ vAPI.tabs.onPopupUpdated = (function() {
context.requestType = 'popup';

// https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764
// 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.
if ( context.requestHostname === '' ) {
// 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.
// 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 '';
}

Expand Down

0 comments on commit 08dd67b

Please sign in to comment.