| Left: | ||
| Right: |
| 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-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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 }; | 694 }; |
| 695 } | 695 } |
| 696 else | 696 else |
| 697 { | 697 { |
| 698 // Edge does not yet support runtime.openOptionsPage (tested version 38) | 698 // Edge does not yet support runtime.openOptionsPage (tested version 38) |
| 699 // and so this workaround needs to stay for now. | 699 // and so this workaround needs to stay for now. |
| 700 ext.showOptions = callback => | 700 ext.showOptions = callback => |
| 701 { | 701 { |
| 702 chrome.windows.getLastFocused(win => | 702 chrome.windows.getLastFocused(win => |
| 703 { | 703 { |
| 704 let optionsUrl = chrome.extension.getURL("options.html"); | 704 // NOTE: we expect this else branch to run only on Edge. |
|
Sebastian Noack
2017/06/07 12:05:25
Well, if we should ever merge this upstream it wil
Oleksandr
2017/06/07 12:09:29
From what I understand only Edge does not support
| |
| 705 // We are not using extension.getURL here because of the Edge issue: | |
| 706 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ 10276332/ | |
| 707 let optionsUrl = "options.html"; | |
| 705 let queryInfo = {url: optionsUrl}; | 708 let queryInfo = {url: optionsUrl}; |
| 706 | 709 |
| 707 // extension pages can't be accessed in incognito windows. In order to | 710 // extension pages can't be accessed in incognito windows. In order to |
| 708 // correctly mimic the way in which Chrome opens extension options, | 711 // correctly mimic the way in which Chrome opens extension options, |
| 709 // we have to focus the options page in any other window. | 712 // we have to focus the options page in any other window. |
| 710 if (!win.incognito) | 713 if (!win.incognito) |
| 711 queryInfo.windowId = win.id; | 714 queryInfo.windowId = win.id; |
| 712 | 715 |
| 713 chrome.tabs.query(queryInfo, tabs => | 716 chrome.tabs.query(queryInfo, tabs => |
| 714 { | 717 { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 735 ext.windows = { | 738 ext.windows = { |
| 736 create(createData, callback) | 739 create(createData, callback) |
| 737 { | 740 { |
| 738 chrome.windows.create(createData, createdWindow => | 741 chrome.windows.create(createData, createdWindow => |
| 739 { | 742 { |
| 740 afterTabLoaded(callback)(createdWindow.tabs[0]); | 743 afterTabLoaded(callback)(createdWindow.tabs[0]); |
| 741 }); | 744 }); |
| 742 } | 745 } |
| 743 }; | 746 }; |
| 744 }()); | 747 }()); |
| OLD | NEW |