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

Delta Between Two Patch Sets: lib/filterComposer.js

Issue 29901596: Issue 6493 - Ensure Firefox draws the "Block element" popup window (Closed)
Left Patch Set: Keep the window's width correct Created Oct. 8, 2018, 5:21 p.m.
Right Patch Set: Only resize for Firefox users, but don't worry about the 2px Created Oct. 9, 2018, 12:15 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 | « no previous file | 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 filters: message.filters 184 filters: message.filters
185 }).then(response => 185 }).then(response =>
186 { 186 {
187 // Sometimes sendMessage incorrectly reports a success on Firefox, so 187 // Sometimes sendMessage incorrectly reports a success on Firefox, so
188 // we must check the response too. 188 // we must check the response too.
189 if (!response) 189 if (!response)
190 throw new Error(); 190 throw new Error();
191 191
192 // Sometimes Firefox doesn't draw the window's contents initially, so we 192 // Sometimes Firefox doesn't draw the window's contents initially, so we
193 // resize the window slightly as a workaround. 193 // resize the window slightly as a workaround.
194 // https://issues.adblockplus.org/ticket/6493 194 // https://issues.adblockplus.org/ticket/6493
Thomas Greiner 2018/10/09 11:43:15 Since this issue is specific to Firefox, mind if w
kzar 2018/10/09 11:48:28 I considered doing that, but it seems kind of inco
Thomas Greiner 2018/10/09 12:00:27 I'm not the one to judge but I'd prefer a good UX
kzar 2018/10/09 12:16:37 Fair enough, Done.
195 browser.windows.update(window.id, {width: window.width + 2}).then( 195 if (info.application == "firefox")
Thomas Greiner 2018/10/09 11:43:15 Detail: Do we even need to wait for the callback o
kzar 2018/10/09 11:48:28 Well, doing it this way seemed better since I worr
Thomas Greiner 2018/10/09 12:00:27 Presumably, it's a similar assumption as whether +
196 () => { browser.windows.update(window.id, {width: window.width}); } 196 browser.windows.update(window.id, {width: window.width + 2});
kzar 2018/10/08 17:23:15 I checked and the `window.width` property isn't up
Sebastian Noack 2018/10/08 17:33:56 So now we are creating the window with a width of
Jon Sonesen 2018/10/08 18:59:06 Yeah, since this code always ends up updating the
kzar 2018/10/09 09:58:47 I don't think an extra two pixels on the window wi
Thomas Greiner 2018/10/09 11:43:15 Indeed, 2px more or less shouldn't make much of a
kzar 2018/10/09 12:16:37 Alright, I won't bother shrink the window 2px agai
197 );
198 }).catch(e => 197 }).catch(e =>
199 { 198 {
200 // Firefox sometimes sets the status for a window to "complete" before 199 // Firefox sometimes sets the status for a window to "complete" before
201 // it is ready to receive messages[1]. As a workaround we'll try again a 200 // it is ready to receive messages[1]. As a workaround we'll try again a
202 // few times with a second delay. 201 // few times with a second delay.
203 // [1] - https://bugzilla.mozilla.org/show_bug.cgi?id=1418655 202 // [1] - https://bugzilla.mozilla.org/show_bug.cgi?id=1418655
204 setTimeout(doInit, 100); 203 setTimeout(doInit, 100);
205 }); 204 });
206 }; 205 };
207 if (window.tabs[0].status != "complete") 206 if (window.tabs[0].status != "complete")
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 port.on("composer.isPageReady", (message, sender) => 364 port.on("composer.isPageReady", (message, sender) =>
366 { 365 {
367 return readyActivePages.has(new ext.Page({id: message.pageId})); 366 return readyActivePages.has(new ext.Page({id: message.pageId}));
368 }); 367 });
369 368
370 port.on("composer.ready", (message, sender) => 369 port.on("composer.ready", (message, sender) =>
371 { 370 {
372 readyActivePages.set(sender.page, !checkWhitelisted(sender.page)); 371 readyActivePages.set(sender.page, !checkWhitelisted(sender.page));
373 updateContextMenu(sender.page); 372 updateContextMenu(sender.page);
374 }); 373 });
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld