From da9aaf73e19c09c3d283a611ad52fb63642d5af7 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 27 Apr 2015 11:07:51 -0400 Subject: [PATCH] this fixes https://github.com/gorhill/uBlock/issues/135 and #1329 --- src/js/background.js | 2 ++ src/js/start.js | 10 ++++++++++ src/js/tab.js | 8 +++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index e2a543a3f..d721c6e89 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -71,9 +71,11 @@ return { netWhitelist: {}, netWhitelistModifyTime: 0, netWhitelistDefault: [ + 'about-scheme', 'behind-the-scene', 'chrome-extension-scheme', 'chrome-scheme', + 'loopconversation.about-scheme', 'opera-scheme' ].join('\n').trim(), diff --git a/src/js/start.js b/src/js/start.js index bb7129683..b660644db 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -81,6 +81,16 @@ var onVersionReady = function(lastVersion) { ); µb.saveWhitelist(); } + // https://github.com/gorhill/uBlock/issues/135#issuecomment-96677379 + // `about:loopconversation` is used by Firefox for its Hello service + if ( lastVersion.localeCompare('0.9.3.5') <= 0 ) { + µb.netWhitelist = µb.whitelistFromString( + µb.stringFromWhitelist(µb.netWhitelist) + + '\n' + + 'loopconversation.about-scheme' + ); + µb.saveWhitelist(); + } if ( lastVersion !== vAPI.app.version ) { vAPI.storage.set({ version: vAPI.app.version }); } diff --git a/src/js/tab.js b/src/js/tab.js index e0ffe35f9..26c90038b 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -55,13 +55,15 @@ var µb = µBlock; return uri.normalizedURI(); } - var url = 'http://' + scheme + '-scheme/'; + var fakeHostname = scheme + '-scheme'; if ( uri.hostname !== '' ) { - url += uri.hostname + '/'; + fakeHostname = uri.hostname + '.' + fakeHostname; + } else if ( scheme === 'about' && uri.path !== '' ) { + fakeHostname = uri.path + '.' + fakeHostname; } - return url; + return 'http://' + fakeHostname + '/'; }; /******************************************************************************/