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

Delta Between Two Patch Sets: lib/options.js

Issue 29536764: Issue 5587, 5748 - Use mobile options page on Firefox for Android (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Do not callback if tab not found Created Oct. 4, 2017, 3:34 a.m.
Right Patch Set: Remove workaround for FOUC issue and update adblockplusui dependency Created Oct. 5, 2017, 1:24 p.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 | « lib/notificationHelper.js ('k') | metadata.chrome » ('j') | 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 callback(new ext.Page(optionsTab)); 52 callback(new ext.Page(optionsTab));
53 } 53 }
54 else 54 else
55 { 55 {
56 // If we don't already have an options page, it means we've just opened 56 // If we don't already have an options page, it means we've just opened
57 // one, in which case we must find the tab, wait for it to be ready, and 57 // one, in which case we must find the tab, wait for it to be ready, and
58 // then return the call. 58 // then return the call.
59 findOptionsTab(tab => 59 findOptionsTab(tab =>
60 { 60 {
61 if (!tab) 61 if (!tab)
62 {
63 // This likely means that there was an error.
64 return; 62 return;
65 }
66 63
67 function onMessage(message, sender) 64 function onMessage(message, sender)
68 { 65 {
69 if (message.type == "app.listen" && 66 if (message.type == "app.listen" &&
70 sender.page && sender.page.id == tab.id) 67 sender.page && sender.page.id == tab.id)
71 { 68 {
72 port.off("app.listen", onMessage); 69 port.off("app.listen", onMessage);
73 callback(new ext.Page(tab)); 70 callback(new ext.Page(tab));
74 } 71 }
75 } 72 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 args: [ 143 args: [
147 { 144 {
148 host: getDecodedHostname(currentPage.url).replace(/^www\./, ""), 145 host: getDecodedHostname(currentPage.url).replace(/^www\./, ""),
149 whitelisted: !!checkWhitelisted(currentPage) 146 whitelisted: !!checkWhitelisted(currentPage)
150 } 147 }
151 ] 148 ]
152 }); 149 });
153 }); 150 });
154 }); 151 });
155 }); 152 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld