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

Side by Side Diff: lib/filterComposer.js

Issue 29901596: Issue 6493 - Ensure Firefox draws the "Block element" popup window (Closed)
Patch Set: Created Oct. 4, 2018, 3:29 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 browser.tabs.sendMessage(popupPageId, { 181 browser.tabs.sendMessage(popupPageId, {
182 type: "composer.dialog.init", 182 type: "composer.dialog.init",
183 sender: sender.page.id, 183 sender: sender.page.id,
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
192 // Sometimes Firefox doesn't draw the window's contents initially, so we
193 // resize the window slightly as a workaround.
194 // https://issues.adblockplus.org/ticket/6493
195 browser.windows.update(window.id, {width: 422});
kzar 2018/10/04 15:30:37 For some reason one pixel larger wasn't enough to
Sebastian Noack 2018/10/04 18:38:55 Would it work if we remove the width from the brow
kzar 2018/10/08 14:50:13 Well, I tried that but initially the width of the
191 }).catch(e => 196 }).catch(e =>
192 { 197 {
193 // Firefox sometimes sets the status for a window to "complete" before 198 // Firefox sometimes sets the status for a window to "complete" before
194 // it is ready to receive messages[1]. As a workaround we'll try again a 199 // it is ready to receive messages[1]. As a workaround we'll try again a
195 // few times with a second delay. 200 // few times with a second delay.
196 // [1] - https://bugzilla.mozilla.org/show_bug.cgi?id=1418655 201 // [1] - https://bugzilla.mozilla.org/show_bug.cgi?id=1418655
197 setTimeout(doInit, 100); 202 setTimeout(doInit, 100);
198 }); 203 });
199 }; 204 };
200 if (window.tabs[0].status != "complete") 205 if (window.tabs[0].status != "complete")
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 port.on("composer.isPageReady", (message, sender) => 363 port.on("composer.isPageReady", (message, sender) =>
359 { 364 {
360 return readyActivePages.has(new ext.Page({id: message.pageId})); 365 return readyActivePages.has(new ext.Page({id: message.pageId}));
361 }); 366 });
362 367
363 port.on("composer.ready", (message, sender) => 368 port.on("composer.ready", (message, sender) =>
364 { 369 {
365 readyActivePages.set(sender.page, !checkWhitelisted(sender.page)); 370 readyActivePages.set(sender.page, !checkWhitelisted(sender.page));
366 updateContextMenu(sender.page); 371 updateContextMenu(sender.page);
367 }); 372 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld