| OLD | NEW |
| 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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 exports.isKnownWindow = function ff_isKnownWindow(window) | 220 exports.isKnownWindow = function ff_isKnownWindow(window) |
| 221 { | 221 { |
| 222 return (window.document.documentElement.getAttribute("windowtype") == "nav
igator:browser"); | 222 return (window.document.documentElement.getAttribute("windowtype") == "nav
igator:browser"); |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 exports.getBrowser = (window) => window.gBrowser; | 225 exports.getBrowser = (window) => window.gBrowser; |
| 226 | 226 |
| 227 exports.addTab = function ff_addTab(window, url, event) | 227 exports.addTab = function ff_addTab(window, url, event) |
| 228 { | 228 { |
| 229 if (event) | 229 if (event) |
| 230 window.openNewTabWith(url, exports.getBrowser(window).contentDocument, n
ull, event, false); | 230 window.openNewTabWith(url, null, null, event, false); |
| 231 else | 231 else |
| 232 window.gBrowser.loadOneTab(url, {inBackground: false}); | 232 window.gBrowser.loadOneTab(url, {inBackground: false}); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 exports.contentContextMenu = "contentAreaContextMenu"; | 235 exports.contentContextMenu = "contentAreaContextMenu"; |
| 236 | 236 |
| 237 exports.defaultToolbarPosition = { | 237 exports.defaultToolbarPosition = { |
| 238 parent: "nav-bar" | 238 parent: "nav-bar" |
| 239 }; | 239 }; |
| 240 | 240 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 268 { | 268 { |
| 269 exports.isKnownWindow = function sm_isKnownWindow(window) | 269 exports.isKnownWindow = function sm_isKnownWindow(window) |
| 270 { | 270 { |
| 271 let type = window.document.documentElement.getAttribute("windowtype"); | 271 let type = window.document.documentElement.getAttribute("windowtype"); |
| 272 return (type == "navigator:browser" || type == "mail:3pane" || type == "ma
il:messageWindow"); | 272 return (type == "navigator:browser" || type == "mail:3pane" || type == "ma
il:messageWindow"); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 exports.addTab = function sm_addTab(window, url, event) | 275 exports.addTab = function sm_addTab(window, url, event) |
| 276 { | 276 { |
| 277 if (event || !("gBrowser" in window)) | 277 if (event || !("gBrowser" in window)) |
| 278 window.openNewTabWith(url, ("gBrowser" in window ? window.gBrowser.conte
ntDocument : null), null, event, false); | 278 window.openNewTabWith(url, null, null, event, false); |
| 279 else | 279 else |
| 280 window.gBrowser.loadOneTab(url, {inBackground: false}); | 280 window.gBrowser.loadOneTab(url, {inBackground: false}); |
| 281 }; | 281 }; |
| 282 | 282 |
| 283 exports.getBrowser = function sm_getBrowser(window) | 283 exports.getBrowser = function sm_getBrowser(window) |
| 284 { | 284 { |
| 285 if ("gBrowser" in window) | 285 if ("gBrowser" in window) |
| 286 return window.gBrowser; | 286 return window.gBrowser; |
| 287 else if ("getMessageBrowser" in window) | 287 else if ("getMessageBrowser" in window) |
| 288 return window.getMessageBrowser(); | 288 return window.getMessageBrowser(); |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 event.state = {id: require("info").addonID}; | 842 event.state = {id: require("info").addonID}; |
| 843 browser._contentWindow.dispatchEvent(event); | 843 browser._contentWindow.dispatchEvent(event); |
| 844 }); | 844 }); |
| 845 }); | 845 }); |
| 846 }, true); | 846 }, true); |
| 847 }; | 847 }; |
| 848 | 848 |
| 849 break; | 849 break; |
| 850 } | 850 } |
| 851 } | 851 } |
| OLD | NEW |