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

Side by Side Diff: lib/child/cssProperties.js

Issue 29338928: Issue 3853 - Use new messaging API for the first-run page (Closed)
Patch Set: Created March 22, 2016, 1:54 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
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 11 matching lines...) Expand all
22 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); 22 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
23 23
24 let {port} = require("messaging"); 24 let {port} = require("messaging");
25 let {getFrames} = require("child/utils"); 25 let {getFrames} = require("child/utils");
26 26
27 let senderWindow = null; 27 let senderWindow = null;
28 28
29 let scope = { 29 let scope = {
30 ext: { 30 ext: {
31 backgroundPage: { 31 backgroundPage: {
32 sendMessage: function(data, callback) 32 sendMessage: function(payload, callback)
33 { 33 {
34 data = {payload: data, frames: getFrames(senderWindow)}; 34 let message = {payload, frames: getFrames(senderWindow)};
35 if (typeof callback == "function") 35 if (typeof callback == "function")
36 port.emitWithResponse("cssPropertiesRequest", data).then(callback); 36 port.emitWithResponse("ext_message", message).then(callback);
37 else 37 else
38 port.emit("cssPropertiesRequest", data); 38 port.emit("ext_message", message);
39 } 39 }
40 } 40 }
41 } 41 }
42 }; 42 };
43 43
44 function loadScript(script) 44 function loadScript(script)
45 { 45 {
46 Services.scriptloader.loadSubScript(script, scope); 46 Services.scriptloader.loadSubScript(script, scope);
47 } 47 }
48 48
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 false); 92 false);
93 onShutdown.add(() => 93 onShutdown.add(() =>
94 { 94 {
95 Services.obs.removeObserver(onContentWindow, 95 Services.obs.removeObserver(onContentWindow,
96 "content-document-global-created"); 96 "content-document-global-created");
97 }); 97 });
98 } 98 }
99 99
100 initCSSPropertyFilters(); 100 initCSSPropertyFilters();
101 })(); 101 })();
OLDNEW
« ext/common.js ('K') | « ext/content.js ('k') | lib/cssProperties.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld