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-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 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 // We are not using extension.getURL to get the absolute path here | 739 // We are not using extension.getURL to get the absolute path here |
740 // because of the Edge issue: | 740 // because of the Edge issue: |
741 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10
276332/ | 741 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10
276332/ |
742 let optionsUrl = "options.html"; | 742 let optionsUrl = "options.html"; |
743 let fullOptionsUrl = ext.getURL(optionsUrl); | 743 let fullOptionsUrl = ext.getURL(optionsUrl); |
744 | 744 |
745 chrome.tabs.query({}, tabs => | 745 chrome.tabs.query({}, tabs => |
746 { | 746 { |
747 // We find a tab ourselves because Edge has a bug when quering tabs | 747 // We find a tab ourselves because Edge has a bug when quering tabs |
748 // with extension URL protocol: | 748 // with extension URL protocol: |
749 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
8094141/ | 749 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
8094141/ |
750 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
8604703/ | 750 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
8604703/ |
751 let tab = tabs.find(element => element.url == fullOptionsUrl); | 751 let tab = tabs.find(element => element.url == fullOptionsUrl); |
752 if (tab) | 752 if (tab) |
753 { | 753 { |
754 chrome.windows.update(tab.windowId, {focused: true}); | 754 chrome.windows.update(tab.windowId, {focused: true}); |
755 chrome.tabs.update(tab.id, {active: true}); | 755 chrome.tabs.update(tab.id, {active: true}); |
756 | 756 |
757 if (callback) | 757 if (callback) |
758 callback(new Page(tab)); | 758 callback(new Page(tab)); |
759 } | 759 } |
(...skipping 17 matching lines...) Expand all Loading... |
777 ext.windows = { | 777 ext.windows = { |
778 create(createData, callback) | 778 create(createData, callback) |
779 { | 779 { |
780 chrome.windows.create(createData, createdWindow => | 780 chrome.windows.create(createData, createdWindow => |
781 { | 781 { |
782 afterTabLoaded(callback)(createdWindow.tabs[0]); | 782 afterTabLoaded(callback)(createdWindow.tabs[0]); |
783 }); | 783 }); |
784 } | 784 } |
785 }; | 785 }; |
786 }()); | 786 }()); |
OLD | NEW |