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

Delta Between Two Patch Sets: ext/background.js

Issue 29527662: Noissue - Open options.html directly on Firefox for Android (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Created Aug. 25, 2017, 11:20 a.m.
Right Patch Set: Don't check for tabs being null Created Aug. 25, 2017, 11:26 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 if ("windows" in chrome) 740 if ("windows" in chrome)
741 { 741 {
742 chrome.windows.getLastFocused(win => 742 chrome.windows.getLastFocused(win =>
743 { 743 {
744 let optionsUrl = "options.html"; 744 let optionsUrl = "options.html";
745 let queryInfo = {url: optionsUrl}; 745 let queryInfo = {url: optionsUrl};
746 746
747 // extension pages can't be accessed in incognito windows. In order to 747 // extension pages can't be accessed in incognito windows. In order to
748 // correctly mimic the way in which Chrome opens extension options, 748 // correctly mimic the way in which Chrome opens extension options,
749 // we have to focus the options page in any other window. 749 // we have to focus the options page in any other window.
750 if (!win.incognito) 750 if (!win.incognito)
Manish Jethani 2017/08/25 11:24:38 No longer checking for win being null The rest of
751 queryInfo.windowId = win.id; 751 queryInfo.windowId = win.id;
752 752
753 chrome.tabs.query(queryInfo, tabs => 753 chrome.tabs.query(queryInfo, tabs =>
754 { 754 {
755 if (tabs && tabs.length > 0) 755 if (tabs.length > 0)
756 { 756 {
757 let tab = tabs[0]; 757 let tab = tabs[0];
758 758
759 if ("windows" in chrome) 759 if ("windows" in chrome)
760 chrome.windows.update(tab.windowId, {focused: true}); 760 chrome.windows.update(tab.windowId, {focused: true});
761 761
762 chrome.tabs.update(tab.id, {active: true}); 762 chrome.tabs.update(tab.id, {active: true});
763 763
764 if (callback) 764 if (callback)
765 callback(new Page(tab)); 765 callback(new Page(tab));
(...skipping 19 matching lines...) Expand all
785 ext.windows = { 785 ext.windows = {
786 create(createData, callback) 786 create(createData, callback)
787 { 787 {
788 chrome.windows.create(createData, createdWindow => 788 chrome.windows.create(createData, createdWindow =>
789 { 789 {
790 afterTabLoaded(callback)(createdWindow.tabs[0]); 790 afterTabLoaded(callback)(createdWindow.tabs[0]);
791 }); 791 });
792 } 792 }
793 }; 793 };
794 }()); 794 }());
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld