Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jan 18, 2017
1 parent 54032e5 commit 69fc593
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/js/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,26 +561,23 @@ vAPI.tabs.onPopupUpdated = (function() {
context.requestHostname = µb.URI.hostnameFromURI(targetURL);
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.
// https://github.com/gorhill/uBlock/issues/1735
// Do not bail out on `data:` URI, they are commonly used for popups.
// https://github.com/uBlockOrigin/uAssets/issues/255
// Do not bail out on `about:blank`: an `about:blank` popup can be
// opened, with the sole purpose to serve as an intermediary in
// a sequence of chained popups.
if (
context.requestHostname === '' &&
targetURL.startsWith('data:') === false &&
targetURL !== 'about:blank'
) {
return '';
}
// https://github.com/uBlockOrigin/uAssets/issues/263#issuecomment-272615772
// Do not bail out, period: the static filtering engine must be
// able to examine all sorts of URLs for popup filtering purpose.

// Dynamic filtering makes sense only when we have a valid hostname.
if ( openerHostname !== '' ) {
// Dynamic filtering makes sense only when we have a valid opener
// hostname.
// 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 ( openerHostname !== '' && targetURL !== 'about:blank' ) {
// Check per-site switch first
if ( µb.hnSwitches.evaluateZ('no-popups', openerHostname) ) {
if ( typeof clickedURL === 'string' && areDifferentURLs(targetURL, clickedURL) ) {
Expand Down

0 comments on commit 69fc593

Please sign in to comment.