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

Side by Side Diff: ext/background.js

Issue 29531677: Issue 5599 - ext needs to be defined in the postload script (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: New approach as discussed in the bug Created Sept. 1, 2017, 8:37 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 | « no previous file | lib/composer.js » ('j') | metadata.chrome » ('J')
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
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/
hub 2017/09/01 20:41:36 only here to pass eslint (trailing space)
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
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 }());
OLDNEW
« no previous file with comments | « no previous file | lib/composer.js » ('j') | metadata.chrome » ('J')

Powered by Google App Engine
This is Rietveld