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

Side by Side Diff: common.js

Issue 29573083: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Add polyfill.js to README.md Created Oct. 17, 2017, 12:35 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 | « background.js ('k') | desktop-options.html » ('j') | 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 /* globals Components */ 18 /* globals Components */
19 19
20 "use strict"; 20 "use strict";
21 21
22 function E(id) 22 function E(id)
23 { 23 {
24 return document.getElementById(id); 24 return document.getElementById(id);
25 } 25 }
26 26
27 function getDocLink(link, callback) 27 function getDocLink(link, callback)
28 { 28 {
29 chrome.runtime.sendMessage({ 29 browser.runtime.sendMessage({
30 type: "app.get", 30 type: "app.get",
31 what: "doclink", 31 what: "doclink",
32 link 32 link
33 }, callback); 33 }, callback);
34 } 34 }
35 35
36 function setLinks(id, ...args) 36 function setLinks(id, ...args)
37 { 37 {
38 let element = E(id); 38 let element = E(id);
39 if (!element) 39 if (!element)
(...skipping 13 matching lines...) Expand all
53 else if (typeof args[i] == "function") 53 else if (typeof args[i] == "function")
54 { 54 {
55 links[i].href = "javascript:void(0);"; 55 links[i].href = "javascript:void(0);";
56 links[i].addEventListener("click", args[i], false); 56 links[i].addEventListener("click", args[i], false);
57 } 57 }
58 } 58 }
59 } 59 }
60 60
61 function checkShareResource(url, callback) 61 function checkShareResource(url, callback)
62 { 62 {
63 chrome.runtime.sendMessage({ 63 browser.runtime.sendMessage({
64 type: "filters.blocked", 64 type: "filters.blocked",
65 url, 65 url,
66 requestType: "SCRIPT", 66 requestType: "SCRIPT",
67 docDomain: "adblockplus.org", 67 docDomain: "adblockplus.org",
68 thirdParty: true 68 thirdParty: true
69 }, callback); 69 }, callback);
70 } 70 }
71 71
72 function openSharePopup(url) 72 function openSharePopup(url)
73 { 73 {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 window.removeEventListener("message", popupMessageListener); 170 window.removeEventListener("message", popupMessageListener);
171 } 171 }
172 172
173 iframe.removeEventListener("load", popupLoadListener); 173 iframe.removeEventListener("load", popupLoadListener);
174 }; 174 };
175 iframe.addEventListener("load", popupLoadListener, false); 175 iframe.addEventListener("load", popupLoadListener, false);
176 176
177 iframe.src = url; 177 iframe.src = url;
178 glassPane.className = "visible"; 178 glassPane.className = "visible";
179 } 179 }
OLDNEW
« no previous file with comments | « background.js ('k') | desktop-options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld