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

Side by Side Diff: lib/filterComposer.js

Issue 29370947: Issue 3138 - Improve how context menu "block element" handles iframes (Closed)
Patch Set: Rebased Created Aug. 9, 2017, 3:27 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
« composer.postload.js ('K') | « ext/background.js ('k') | 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 filters.push(docDomain.replace(/^www\./, "") + "##" + selector); 161 filters.push(docDomain.replace(/^www\./, "") + "##" + selector);
162 } 162 }
163 } 163 }
164 164
165 return {filters, selectors}; 165 return {filters, selectors};
166 } 166 }
167 167
168 let contextMenuItem = { 168 let contextMenuItem = {
169 title: ext.i18n.getMessage("block_element"), 169 title: ext.i18n.getMessage("block_element"),
170 contexts: ["image", "video", "audio"], 170 contexts: ["image", "video", "audio"],
171 onclick(page) 171 onclick(page, info)
172 { 172 {
173 page.sendMessage({type: "composer.content.contextMenuClicked"}); 173 page.sendMessage(
174 {type: "composer.content.contextMenuClicked"}, undefined, info.frameId
175 );
174 } 176 }
175 }; 177 };
176 178
177 function updateContextMenu(page, filter) 179 function updateContextMenu(page, filter)
178 { 180 {
179 page.contextMenus.remove(contextMenuItem); 181 page.contextMenus.remove(contextMenuItem);
180 182
181 if (typeof filter == "undefined") 183 if (typeof filter == "undefined")
182 filter = checkWhitelisted(page); 184 filter = checkWhitelisted(page);
183 if (!filter && Prefs.shouldShowBlockElementMenu && readyPages.has(page)) 185 if (!filter && Prefs.shouldShowBlockElementMenu && readyPages.has(page))
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 253
252 port.on("composer.quoteCSS", (message, sender) => 254 port.on("composer.quoteCSS", (message, sender) =>
253 { 255 {
254 return quoteCSS(message.CSS); 256 return quoteCSS(message.CSS);
255 }); 257 });
256 258
257 ext.pages.onLoading.addListener(page => 259 ext.pages.onLoading.addListener(page =>
258 { 260 {
259 page.sendMessage({type: "composer.content.finished"}); 261 page.sendMessage({type: "composer.content.finished"});
260 }); 262 });
OLDNEW
« composer.postload.js ('K') | « ext/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld