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

Unified Diff: lib/filterComposer.js

Issue 29901596: Issue 6493 - Ensure Firefox draws the "Block element" popup window (Closed)
Patch Set: Keep the window's width correct Created Oct. 8, 2018, 5:21 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterComposer.js
diff --git a/lib/filterComposer.js b/lib/filterComposer.js
index fe5dcdf3071e1762e31cfb4e4bd461a67bbcac23..14c07776c2d5a8cf0d206d52cd3b01bbd38675b6 100644
--- a/lib/filterComposer.js
+++ b/lib/filterComposer.js
@@ -188,6 +188,13 @@ port.on("composer.openDialog", (message, sender) =>
// we must check the response too.
if (!response)
throw new Error();
+
+ // Sometimes Firefox doesn't draw the window's contents initially, so we
+ // resize the window slightly as a workaround.
+ // 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.
+ browser.windows.update(window.id, {width: window.width + 2}).then(
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 +
+ () => { browser.windows.update(window.id, {width: window.width}); }
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
+ );
}).catch(e =>
{
// Firefox sometimes sets the status for a window to "complete" before
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld