| Left: | ||
| Right: | 
| LEFT | RIGHT | 
|---|---|
| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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, E */ | 18 /* globals Components */ | 
| 
 
Thomas Greiner
2017/03/01 17:39:34
Detail: You're also defining `E` as a local variab
 
kzar
2017/03/07 12:48:31
Well as it is with `window.E = function E(id)` the
 
Thomas Greiner
2017/03/07 13:33:00
Since we no longer have it inside a closure we no
 
 | |
| 19 | 19 | 
| 20 "use strict"; | 20 "use strict"; | 
| 21 | 21 | 
| 22 window.E = function E(id) | 22 function E(id) | 
| 23 { | 23 { | 
| 24 return document.getElementById(id); | 24 return document.getElementById(id); | 
| 25 }; | 25 } | 
| 26 | 26 | 
| 27 window.getDocLink = function(link, callback) | 27 function getDocLink(link, callback) | 
| 28 { | 28 { | 
| 29 ext.backgroundPage.sendMessage({ | 29 ext.backgroundPage.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 window.checkShareResource = function(url, callback) | 36 function checkShareResource(url, callback) | 
| 37 { | 37 { | 
| 38 ext.backgroundPage.sendMessage({ | 38 ext.backgroundPage.sendMessage({ | 
| 39 type: "filters.blocked", | 39 type: "filters.blocked", | 
| 40 url, | 40 url, | 
| 41 requestType: "SCRIPT", | 41 requestType: "SCRIPT", | 
| 42 docDomain: "adblockplus.org", | 42 docDomain: "adblockplus.org", | 
| 43 thirdParty: true | 43 thirdParty: true | 
| 44 }, callback); | 44 }, callback); | 
| 45 }; | 45 } | 
| 46 | 46 | 
| 47 window.openSharePopup = function(url) | 47 function openSharePopup(url) | 
| 
 
Thomas Greiner
2017/03/01 17:39:34
Interesting that we're not using arrow functions f
 
kzar
2017/03/07 12:48:31
Well I've changed this to a regular named function
 
 | |
| 48 { | 48 { | 
| 49 let glassPane = E("glass-pane"); | 49 let glassPane = E("glass-pane"); | 
| 50 if (!glassPane) | 50 if (!glassPane) | 
| 51 { | 51 { | 
| 52 glassPane = document.createElement("div"); | 52 glassPane = document.createElement("div"); | 
| 53 glassPane.setAttribute("id", "glass-pane"); | 53 glassPane.setAttribute("id", "glass-pane"); | 
| 54 document.body.appendChild(glassPane); | 54 document.body.appendChild(glassPane); | 
| 55 } | 55 } | 
| 56 | 56 | 
| 57 let iframe = E("share-popup"); | 57 let iframe = E("share-popup"); | 
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 glassPane.className = ""; | 144 glassPane.className = ""; | 
| 145 window.removeEventListener("message", popupMessageListener); | 145 window.removeEventListener("message", popupMessageListener); | 
| 146 } | 146 } | 
| 147 | 147 | 
| 148 iframe.removeEventListener("load", popupLoadListener); | 148 iframe.removeEventListener("load", popupLoadListener); | 
| 149 }; | 149 }; | 
| 150 iframe.addEventListener("load", popupLoadListener, false); | 150 iframe.addEventListener("load", popupLoadListener, false); | 
| 151 | 151 | 
| 152 iframe.src = url; | 152 iframe.src = url; | 
| 153 glassPane.className = "visible"; | 153 glassPane.className = "visible"; | 
| 154 }; | 154 } | 
| LEFT | RIGHT |