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

Delta Between Two Patch Sets: ext/common.js

Issue 4731979438227456: Issue 1663 - Emulate background page and implement proper message responder (Closed)
Left Patch Set: Rebased and addressed comments Created Dec. 18, 2014, 9:52 p.m.
Right Patch Set: Using Services.vc Created Dec. 19, 2014, 5:45 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 | « ext/background.js ('k') | ext/content.js » ('j') | messageResponder.js » ('J')
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 <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 16 matching lines...) Expand all
27 Page.prototype = 27 Page.prototype =
28 { 28 {
29 sendMessage: function(message) 29 sendMessage: function(message)
30 { 30 {
31 this._source.postMessage({ 31 this._source.postMessage({
32 type: "message", 32 type: "message",
33 messageId: -1, 33 messageId: -1,
34 payload: message 34 payload: message
35 }, "*"); 35 }, "*");
36 } 36 }
37 } 37 };
38
39 global.ext.Page = Page;
38 40
39 /* Message passing */ 41 /* Message passing */
40 42
41 global.ext.onMessage = 43 global.ext.onMessage =
42 { 44 {
43 addListener: function(listener) 45 addListener: function(listener)
44 { 46 {
45 listener._extWrapper = function(event) 47 listener._extWrapper = function(event)
46 { 48 {
47 if (event.data.type != "message") 49 if (event.data.type != "message")
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 188 }
187 189
188 if (locales.length == 0) 190 if (locales.length == 0)
189 return ""; 191 return "";
190 192
191 readCatalog(locales.shift()); 193 readCatalog(locales.shift());
192 } 194 }
193 } 195 }
194 }; 196 };
195 })(this); 197 })(this);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld