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

Delta Between Two Patch Sets: lib/options.js

Issue 29730656: Issue 6476 - Update adblockplusui dependencies to ead38c2013b5 (Closed)
Left Patch Set: Created March 22, 2018, 8:45 p.m.
Right Patch Set: updated git dependency Created March 23, 2018, 3 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 | « lib/notificationHelper.js ('k') | no next file » | 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 { 110 {
111 if (message.type != "app.listen") 111 if (message.type != "app.listen")
112 return; 112 return;
113 113
114 port.onMessage.removeListener(onMessage); 114 port.onMessage.removeListener(onMessage);
115 callback(new ext.Page(tab), port); 115 callback(new ext.Page(tab), port);
116 } 116 }
117 117
118 function onConnect(port) 118 function onConnect(port)
119 { 119 {
120 let {name, sender} = port; 120 if (port.name != "ui" || port.sender.tab.id != tab.id)
Sebastian Noack 2018/03/23 00:01:48 Nit: I wouldn't care to destructure the port here,
saroyanm 2018/03/23 12:03:18 Done.
121 if (name != "ui" || !sender || sender.tab.id != tab.id)
Sebastian Noack 2018/03/23 00:01:48 Under which circumstances do we need to check for
saroyanm 2018/03/23 11:26:47 I assume because this is optional, but according t
saroyanm 2018/03/23 12:03:17 Done.
122 return; 121 return;
123 122
124 browser.runtime.onConnect.removeListener(onConnect); 123 browser.runtime.onConnect.removeListener(onConnect);
125 port.onMessage.addListener(onMessage); 124 port.onMessage.addListener(onMessage);
126 } 125 }
127 126
128 browser.runtime.onConnect.addListener(onConnect); 127 browser.runtime.onConnect.addListener(onConnect);
129 }); 128 });
130 } 129 }
131 } 130 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 { 202 {
204 browser.tabs.query({active: true, lastFocusedWindow: true}, ([tab]) => 203 browser.tabs.query({active: true, lastFocusedWindow: true}, ([tab]) =>
205 { 204 {
206 let currentPage = new ext.Page(tab); 205 let currentPage = new ext.Page(tab);
207 206
208 showOptions((optionsPage, port) => 207 showOptions((optionsPage, port) =>
209 { 208 {
210 if (!/^https?:$/.test(currentPage.url.protocol)) 209 if (!/^https?:$/.test(currentPage.url.protocol))
211 return; 210 return;
212 211
213 port.postMessage({ 212 port.postMessage({
Sebastian Noack 2018/03/23 00:01:48 Nit: The indentation is off here.
saroyanm 2018/03/23 12:03:18 Done.
214 type: "app.respond", 213 type: "app.respond",
215 action: "showPageOptions", 214 action: "showPageOptions",
216 args: [ 215 args: [
217 { 216 {
218 host: getDecodedHostname(currentPage.url).replace(/^www\./, ""), 217 host: getDecodedHostname(currentPage.url).replace(/^www\./, ""),
219 whitelisted: !!checkWhitelisted(currentPage) 218 whitelisted: !!checkWhitelisted(currentPage)
220 } 219 }
221 ] 220 ]
222 }); 221 });
223 }); 222 });
224 }); 223 });
225 }); 224 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld