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

Unified Diff: chrome/ext/background.js

Issue 6228201961422848: Issue 2064 - Configure indistinguishable request types in the abstraction layer (Closed)
Patch Set: Ignore MEDIA and FONT filters on Chrome Created March 2, 2015, 7:22 p.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') | safari/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/ext/background.js
===================================================================
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -331,6 +331,23 @@
handlerBehaviorChanged: chrome.webRequest.handlerBehaviorChanged
};
+ // Since Chrome 38 requests of type 'object' (e.g. requests
+ // initiated by Flash) are mistakenly reported with the type 'other'.
+ // https://code.google.com/p/chromium/issues/detail?id=410382
+ if (parseInt(navigator.userAgent.match(/\bChrome\/(\d+)/)[1], 10) >= 38)
+ {
+ ext.webRequest.indistinguishableTypes = [
+ ["OTHER", "OBJECT", "OBJECT_SUBREQUEST"]
+ ];
+ }
+ else
+ {
+ ext.webRequest.indistinguishableTypes = [
+ ["OBJECT", "OBJECT_SUBREQUEST"],
+ ["OTHER", "MEDIA", "FONT"]
+ ];
+ }
+
chrome.tabs.query({}, function(tabs)
{
tabs.forEach(function(tab)
@@ -404,12 +421,6 @@
if (frame)
{
- // Since Chrome 38 requests of type 'object' (e.g. requests
- // initiated by Flash) are mistakenly reported with the type 'other'.
- // https://code.google.com/p/chromium/issues/detail?id=410382
- if (requestType == "OTHER" && parseInt(navigator.userAgent.match(/\bChrome\/(\d+)/)[1], 10) >= 38)
- requestType = "OBJECT";
-
var results = ext.webRequest.onBeforeRequest._dispatch(
url,
requestType,
« no previous file with comments | « background.js ('k') | safari/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld