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

Side by Side Diff: lib/filterComposer.js

Issue 29516679: Issue 5347 - Do not show composer menu item on Firefox for Android (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Check for chrome.windows instead Created Aug. 16, 2017, 8:15 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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 page.sendMessage({type: "composer.content.contextMenuClicked"}); 173 page.sendMessage({type: "composer.content.contextMenuClicked"});
174 } 174 }
175 }; 175 };
176 176
177 function updateContextMenu(page, filter) 177 function updateContextMenu(page, filter)
178 { 178 {
179 page.contextMenus.remove(contextMenuItem); 179 page.contextMenus.remove(contextMenuItem);
180 180
181 if (typeof filter == "undefined") 181 if (typeof filter == "undefined")
182 filter = checkWhitelisted(page); 182 filter = checkWhitelisted(page);
183 if (!filter && Prefs.shouldShowBlockElementMenu && readyPages.has(page)) 183 if (!filter && Prefs.shouldShowBlockElementMenu && readyPages.has(page) &&
184 // Firefox for Android does not support the windows API, which is
185 // required for the composer to work.
Wladimir Palant 2017/08/17 12:22:49 Not really, we could fall back to creating a new t
Manish Jethani 2017/08/17 13:25:19 Do you think it makes sense to make the composer w
Sebastian Noack 2017/08/18 09:23:01 Also, the user experience when selecting elements
Wladimir Palant 2017/08/18 20:52:32 Ok, fine with me.
Sebastian Noack 2017/08/23 12:00:35 Perhaps we should rather check for `info.applicati
Manish Jethani 2017/08/24 10:34:59 Done.
186 "windows" in chrome)
187 {
184 page.contextMenus.create(contextMenuItem); 188 page.contextMenus.create(contextMenuItem);
189 }
185 } 190 }
186 191
187 FilterNotifier.on("page.WhitelistingStateRevalidate", updateContextMenu); 192 FilterNotifier.on("page.WhitelistingStateRevalidate", updateContextMenu);
188 193
189 Prefs.on("shouldShowBlockElementMenu", () => 194 Prefs.on("shouldShowBlockElementMenu", () =>
190 { 195 {
191 ext.pages.query({}, pages => 196 ext.pages.query({}, pages =>
192 { 197 {
193 for (let page of pages) 198 for (let page of pages)
194 updateContextMenu(page); 199 updateContextMenu(page);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 256
252 port.on("composer.quoteCSS", (message, sender) => 257 port.on("composer.quoteCSS", (message, sender) =>
253 { 258 {
254 return quoteCSS(message.CSS); 259 return quoteCSS(message.CSS);
255 }); 260 });
256 261
257 ext.pages.onLoading.addListener(page => 262 ext.pages.onLoading.addListener(page =>
258 { 263 {
259 page.sendMessage({type: "composer.content.finished"}); 264 page.sendMessage({type: "composer.content.finished"});
260 }); 265 });
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