Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: webrequest.js

Issue 29329589: Issue 3238 - Adblock Warning List opt in message should not be triggered by frames (Chrome) (Closed)
Patch Set: Created Nov. 2, 2015, 11:25 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -13,17 +13,16 @@
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
var FilterNotifier = require("filterNotifier").FilterNotifier;
var RegExpFilter = require("filterClasses").RegExpFilter;
var platform = require("info").platform;
-var showNextNotificationForUrl = require("notificationHelper").showNextNotificationForUrl;
ext.webRequest.indistinguishableTypes.forEach(function(types)
{
for (var i = 1; i < types.length; i++)
RegExpFilter.typeMap[types[i]] = RegExpFilter.typeMap[types[0]];
});
FilterNotifier.addListener(function(action, arg)
@@ -44,21 +43,16 @@ FilterNotifier.addListener(function(acti
case "load":
ext.webRequest.handlerBehaviorChanged();
break;
}
});
function onBeforeRequestAsync(url, type, page, filter)
{
- // We can't listen to onHeadersReceived in Safari so we need to
- // check for notifications here
- if (platform != "chromium" && type == "SUBDOCUMENT")
- showNextNotificationForUrl(url);
-
if (filter)
FilterNotifier.triggerListeners("filter.hitCount", filter, 0, 0, page);
}
function onBeforeRequest(url, type, page, frame)
{
if (isFrameWhitelisted(page, frame))
return true;
@@ -93,18 +87,16 @@ if (platform == "chromium")
return;
for (var i = 0; i < details.responseHeaders.length; i++)
{
var header = details.responseHeaders[i];
if (header.name.toLowerCase() == "x-adblock-key" && header.value)
processKey(header.value, page, frame);
}
-
- showNextNotificationForUrl(new URL(details.url));
}
chrome.webRequest.onHeadersReceived.addListener(
onHeadersReceived,
{
urls: ["http://*/*", "https://*/*"],
types: ["main_frame", "sub_frame"]
},
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld