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

Delta Between Two Patch Sets: background.js

Issue 6174977720057856: Issue 1853 - Moved filter generation into background page (Closed)
Left Patch Set: Rebased Created Feb. 13, 2015, 4:11 p.m.
Right Patch Set: Rebased and fixed documentation mistakenly indicating arguments as optional Created Feb. 28, 2015, 5:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | include.postload.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 var composeFilters = require("filterComposer").composeFilters; 58 var composeFilters = require("filterComposer").composeFilters;
60
61 // Some types cannot be distinguished
62 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
63 RegExpFilter.typeMap.MEDIA = RegExpFilter.typeMap.FONT = RegExpFilter.typeMap.OT HER;
64 59
65 // Chrome on Linux does not fully support chrome.notifications until version 35 60 // Chrome on Linux does not fully support chrome.notifications until version 35
66 // https://code.google.com/p/chromium/issues/detail?id=291485 61 // https://code.google.com/p/chromium/issues/detail?id=291485
67 var canUseChromeNotifications = require("info").platform == "chromium" 62 var canUseChromeNotifications = require("info").platform == "chromium"
68 && "notifications" in chrome 63 && "notifications" in chrome
69 && (navigator.platform.indexOf("Linux") == -1 || parseInt(require("info").appl icationVersion, 10) > 34); 64 && (navigator.platform.indexOf("Linux") == -1 || parseInt(require("info").appl icationVersion, 10) > 34);
70 65
71 var seenDataCorruption = false; 66 var seenDataCorruption = false;
72 var filterlistsReinitialized = false; 67 var filterlistsReinitialized = false;
73 require("filterNotifier").FilterNotifier.addListener(function(action) 68 require("filterNotifier").FilterNotifier.addListener(function(action)
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 page.sendMessage({type: "clickhide-deactivate"}); 579 page.sendMessage({type: "clickhide-deactivate"});
585 refreshIconAndContextMenu(page); 580 refreshIconAndContextMenu(page);
586 }); 581 });
587 582
588 setTimeout(function() 583 setTimeout(function()
589 { 584 {
590 var notificationToShow = NotificationStorage.getNextToShow(); 585 var notificationToShow = NotificationStorage.getNextToShow();
591 if (notificationToShow) 586 if (notificationToShow)
592 showNotification(notificationToShow); 587 showNotification(notificationToShow);
593 }, 3 * 60 * 1000); 588 }, 3 * 60 * 1000);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld