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

Side by Side Diff: 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.
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 | chrome/ext/background.js » ('j') | 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 with(require("filterClasses")) 18 with(require("filterClasses"))
19 { 19 {
20 this.Filter = Filter; 20 this.Filter = Filter;
21 this.RegExpFilter = RegExpFilter;
22 this.BlockingFilter = BlockingFilter; 21 this.BlockingFilter = BlockingFilter;
23 this.WhitelistFilter = WhitelistFilter; 22 this.WhitelistFilter = WhitelistFilter;
24 } 23 }
25 with(require("subscriptionClasses")) 24 with(require("subscriptionClasses"))
26 { 25 {
27 this.Subscription = Subscription; 26 this.Subscription = Subscription;
28 this.DownloadableSubscription = DownloadableSubscription; 27 this.DownloadableSubscription = DownloadableSubscription;
29 this.SpecialSubscription = SpecialSubscription; 28 this.SpecialSubscription = SpecialSubscription;
30 } 29 }
31 with(require("whitelisting")) 30 with(require("whitelisting"))
(...skipping 18 matching lines...) Expand all
50 var FilterStorage = require("filterStorage").FilterStorage; 49 var FilterStorage = require("filterStorage").FilterStorage;
51 var ElemHide = require("elemHide").ElemHide; 50 var ElemHide = require("elemHide").ElemHide;
52 var defaultMatcher = require("matcher").defaultMatcher; 51 var defaultMatcher = require("matcher").defaultMatcher;
53 var Prefs = require("prefs").Prefs; 52 var Prefs = require("prefs").Prefs;
54 var Synchronizer = require("synchronizer").Synchronizer; 53 var Synchronizer = require("synchronizer").Synchronizer;
55 var Utils = require("utils").Utils; 54 var Utils = require("utils").Utils;
56 var NotificationStorage = require("notification").Notification; 55 var NotificationStorage = require("notification").Notification;
57 var initAntiAdblockNotification = require("antiadblockInit").initAntiAdblockNoti fication; 56 var initAntiAdblockNotification = require("antiadblockInit").initAntiAdblockNoti fication;
58 var parseFilters = require("filterValidation").parseFilters; 57 var parseFilters = require("filterValidation").parseFilters;
59 58
60 // Some types cannot be distinguished
61 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
62 RegExpFilter.typeMap.MEDIA = RegExpFilter.typeMap.FONT = RegExpFilter.typeMap.OT HER;
63
64 // Chrome on Linux does not fully support chrome.notifications until version 35 59 // Chrome on Linux does not fully support chrome.notifications until version 35
65 // https://code.google.com/p/chromium/issues/detail?id=291485 60 // https://code.google.com/p/chromium/issues/detail?id=291485
66 var canUseChromeNotifications = require("info").platform == "chromium" 61 var canUseChromeNotifications = require("info").platform == "chromium"
67 && "notifications" in chrome 62 && "notifications" in chrome
68 && (navigator.platform.indexOf("Linux") == -1 || parseInt(require("info").appl icationVersion, 10) > 34); 63 && (navigator.platform.indexOf("Linux") == -1 || parseInt(require("info").appl icationVersion, 10) > 34);
69 64
70 var seenDataCorruption = false; 65 var seenDataCorruption = false;
71 var filterlistsReinitialized = false; 66 var filterlistsReinitialized = false;
72 require("filterNotifier").FilterNotifier.addListener(function(action) 67 require("filterNotifier").FilterNotifier.addListener(function(action)
73 { 68 {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 page.sendMessage({type: "clickhide-deactivate"}); 572 page.sendMessage({type: "clickhide-deactivate"});
578 refreshIconAndContextMenu(page); 573 refreshIconAndContextMenu(page);
579 }); 574 });
580 575
581 setTimeout(function() 576 setTimeout(function()
582 { 577 {
583 var notificationToShow = NotificationStorage.getNextToShow(); 578 var notificationToShow = NotificationStorage.getNextToShow();
584 if (notificationToShow) 579 if (notificationToShow)
585 showNotification(notificationToShow); 580 showNotification(notificationToShow);
586 }, 3 * 60 * 1000); 581 }, 3 * 60 * 1000);
OLDNEW
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld