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

Side by Side Diff: background.js

Issue 29338771: Issue 3843 - Move page load logic to their respective modules (Closed)
Patch Set: Created March 20, 2016, 3:46 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 | lib/filterComposer.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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 19 matching lines...) Expand all
30 { 30 {
31 this.stringifyURL = stringifyURL; 31 this.stringifyURL = stringifyURL;
32 this.isThirdParty = isThirdParty; 32 this.isThirdParty = isThirdParty;
33 this.extractHostFromFrame = extractHostFromFrame; 33 this.extractHostFromFrame = extractHostFromFrame;
34 } 34 }
35 var FilterStorage = require("filterStorage").FilterStorage; 35 var FilterStorage = require("filterStorage").FilterStorage;
36 var SpecialSubscription = require("subscriptionClasses").SpecialSubscription; 36 var SpecialSubscription = require("subscriptionClasses").SpecialSubscription;
37 var ElemHide = require("elemHide").ElemHide; 37 var ElemHide = require("elemHide").ElemHide;
38 var defaultMatcher = require("matcher").defaultMatcher; 38 var defaultMatcher = require("matcher").defaultMatcher;
39 var Prefs = require("prefs").Prefs; 39 var Prefs = require("prefs").Prefs;
40 var showNextNotificationForUrl = require("notificationHelper").showNextNotificat ionForUrl;
41 var port = require("messaging").port; 40 var port = require("messaging").port;
42 var devtools = require("devtools"); 41 var devtools = require("devtools");
43 42
44 // This is a hack to speedup loading of the options page on Safari. 43 // This is a hack to speedup loading of the options page on Safari.
45 // Once we replaced the background page proxy with message passing 44 // Once we replaced the background page proxy with message passing
46 // this global function should removed. 45 // this global function should removed.
47 function getUserFilters() 46 function getUserFilters()
48 { 47 {
49 var filters = []; 48 var filters = [];
50 var exceptions = []; 49 var exceptions = [];
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 targetPage = sender.page; 136 targetPage = sender.page;
138 137
139 if (targetPage) 138 if (targetPage)
140 { 139 {
141 msg.payload.sender = sender.page.id; 140 msg.payload.sender = sender.page.id;
142 if (msg.expectsResponse) 141 if (msg.expectsResponse)
143 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); 142 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload));
144 targetPage.sendMessage(msg.payload); 143 targetPage.sendMessage(msg.payload);
145 } 144 }
146 }); 145 });
147
148 // update icon when page changes location
149 ext.pages.onLoading.addListener(function(page)
150 {
151 page.sendMessage({type: "composer.content.finished"});
152 showNextNotificationForUrl(page.url);
153 });
OLDNEW
« no previous file with comments | « no previous file | lib/filterComposer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld