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

Side by Side Diff: chrome/ext/background.js

Issue 4726788198498304: Issue 2537 - Don't assume "Chrome/" to be given in the user agent string (Closed)
Patch Set: Created May 18, 2015, 1:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // it multiple times, if multiple filters are added/removed. 353 // it multiple times, if multiple filters are added/removed.
354 var onBeforeNavigate = chrome.webNavigation.onBeforeNavigate; 354 var onBeforeNavigate = chrome.webNavigation.onBeforeNavigate;
355 if (!onBeforeNavigate.hasListener(propagateHandlerBehaviorChange)) 355 if (!onBeforeNavigate.hasListener(propagateHandlerBehaviorChange))
356 onBeforeNavigate.addListener(propagateHandlerBehaviorChange); 356 onBeforeNavigate.addListener(propagateHandlerBehaviorChange);
357 } 357 }
358 }; 358 };
359 359
360 // Since Chrome 38 requests of type 'object' (e.g. requests 360 // Since Chrome 38 requests of type 'object' (e.g. requests
361 // initiated by Flash) are mistakenly reported with the type 'other'. 361 // initiated by Flash) are mistakenly reported with the type 'other'.
362 // https://code.google.com/p/chromium/issues/detail?id=410382 362 // https://code.google.com/p/chromium/issues/detail?id=410382
363 if (parseInt(navigator.userAgent.match(/\bChrome\/(\d+)/)[1], 10) >= 38) 363 var match = navigator.userAgent.match(/\bChrome\/(\d+)/);
364 if (match && parseInt(match[1], 10) >= 38)
364 { 365 {
365 ext.webRequest.indistinguishableTypes = [ 366 ext.webRequest.indistinguishableTypes = [
366 ["OTHER", "OBJECT", "OBJECT_SUBREQUEST"] 367 ["OTHER", "OBJECT", "OBJECT_SUBREQUEST"]
367 ]; 368 ];
368 } 369 }
369 else 370 else
370 { 371 {
371 ext.webRequest.indistinguishableTypes = [ 372 ext.webRequest.indistinguishableTypes = [
372 ["OBJECT", "OBJECT_SUBREQUEST"], 373 ["OBJECT", "OBJECT_SUBREQUEST"],
373 ["OTHER", "MEDIA", "FONT"] 374 ["OTHER", "MEDIA", "FONT"]
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 callback(new Page(tab)); 654 callback(new Page(tab));
654 } 655 }
655 else 656 else
656 { 657 {
657 ext.pages.open(optionsUrl, callback); 658 ext.pages.open(optionsUrl, callback);
658 } 659 }
659 }); 660 });
660 }); 661 });
661 }; 662 };
662 })(); 663 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld