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

Side by Side Diff: background.js

Issue 5644946291818496: Issue 433 - Made adjustments for $sitekey-related changes to the Matcher API (Closed)
Patch Set: Created Sept. 15, 2014, 9:22 a.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 | include.preload.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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 14 matching lines...) Expand all
25 with(require("subscriptionClasses")) 25 with(require("subscriptionClasses"))
26 { 26 {
27 this.Subscription = Subscription; 27 this.Subscription = Subscription;
28 this.DownloadableSubscription = DownloadableSubscription; 28 this.DownloadableSubscription = DownloadableSubscription;
29 this.SpecialSubscription = SpecialSubscription; 29 this.SpecialSubscription = SpecialSubscription;
30 } 30 }
31 with(require("whitelisting")) 31 with(require("whitelisting"))
32 { 32 {
33 this.isWhitelisted = isWhitelisted; 33 this.isWhitelisted = isWhitelisted;
34 this.isFrameWhitelisted = isFrameWhitelisted; 34 this.isFrameWhitelisted = isFrameWhitelisted;
35 this.processKeyException = processKeyException; 35 this.processKey = processKey;
36 this.getKey = getKey;
36 } 37 }
37 var FilterStorage = require("filterStorage").FilterStorage; 38 var FilterStorage = require("filterStorage").FilterStorage;
38 var ElemHide = require("elemHide").ElemHide; 39 var ElemHide = require("elemHide").ElemHide;
39 var defaultMatcher = require("matcher").defaultMatcher; 40 var defaultMatcher = require("matcher").defaultMatcher;
40 var Prefs = require("prefs").Prefs; 41 var Prefs = require("prefs").Prefs;
41 var Synchronizer = require("synchronizer").Synchronizer; 42 var Synchronizer = require("synchronizer").Synchronizer;
42 var Utils = require("utils").Utils; 43 var Utils = require("utils").Utils;
43 var Notification = require("notification").Notification; 44 var Notification = require("notification").Notification;
44 var initAntiAdblockNotification = require("antiadblockInit").initAntiAdblockNoti fication; 45 var initAntiAdblockNotification = require("antiadblockInit").initAntiAdblockNoti fication;
45 46
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 for (var i = 0; i < msg.filters.length; i++) 550 for (var i = 0; i < msg.filters.length; i++)
550 FilterStorage.addFilter(Filter.fromText(msg.filters[i])); 551 FilterStorage.addFilter(Filter.fromText(msg.filters[i]));
551 } 552 }
552 break; 553 break;
553 case "add-subscription": 554 case "add-subscription":
554 openOptions(function(page) 555 openOptions(function(page)
555 { 556 {
556 page.sendMessage(msg); 557 page.sendMessage(msg);
557 }); 558 });
558 break; 559 break;
559 case "add-key-exception": 560 case "add-sitekey":
560 processKeyException(msg.token, sender.page, sender.frame); 561 processKey(msg.token, sender.page, sender.frame);
561 break; 562 break;
562 case "forward": 563 case "forward":
563 if (sender.page) 564 if (sender.page)
564 { 565 {
565 sender.page.sendMessage(msg.payload, sendResponse); 566 sender.page.sendMessage(msg.payload, sendResponse);
566 // Return true to indicate that we want to call 567 // Return true to indicate that we want to call
567 // sendResponse asynchronously 568 // sendResponse asynchronously
568 return true; 569 return true;
569 } 570 }
570 break; 571 break;
571 default: 572 default:
572 sendResponse({}); 573 sendResponse({});
573 break; 574 break;
574 } 575 }
575 }); 576 });
576 577
577 // update icon when page changes location 578 // update icon when page changes location
578 ext.pages.onLoading.addListener(function(page) 579 ext.pages.onLoading.addListener(function(page)
579 { 580 {
580 page.sendMessage({type: "clickhide-deactivate"}); 581 page.sendMessage({type: "clickhide-deactivate"});
581 refreshIconAndContextMenu(page); 582 refreshIconAndContextMenu(page);
582 }); 583 });
583 584
584 setTimeout(function() 585 setTimeout(function()
585 { 586 {
586 var notificationToShow = Notification.getNextToShow(); 587 var notificationToShow = Notification.getNextToShow();
587 if (notificationToShow) 588 if (notificationToShow)
588 showNotification(notificationToShow); 589 showNotification(notificationToShow);
589 }, 3 * 60 * 1000); 590 }, 3 * 60 * 1000);
OLDNEW
« no previous file with comments | « no previous file | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld