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

Side by Side Diff: lib/uninstall.js

Issue 29332492: Issue 3269 - Display uninstallation page when uninstalled (Closed)
Patch Set: Addressed further comments Created Dec. 12, 2015, 10:16 a.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 | metadata.common » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /** @module uninstall */
19
20 let {Prefs} = require("prefs");
21
22 function setUninstallURL()
23 {
24 let info = require("info");
25 let search = [];
26 for (let key of ["addonName", "addonVersion", "application",
Sebastian Noack 2015/12/12 13:43:27 I just rembered that jshydra generates quite crapp
kzar 2015/12/12 14:13:43 Done.
27 "applicationVersion", "platform", "platformVersion"])
28 search.push(key + "=" + encodeURIComponent(info[key]));
29
30 let downlCount = Prefs.notificationdata.downloadCount || 0;
31 search.push("notificationDownloadCount=" + encodeURIComponent(downlCount));
32
33 chrome.runtime.setUninstallURL(
34 require("utils").Utils.getDocLink("uninstall-abp") + "&" + search.join("&")
Sebastian Noack 2015/12/12 13:43:27 As mentioned in the issue, I think we should just
Sebastian Noack 2015/12/12 13:43:27 I'd rather keep imports at the top, even if only u
kzar 2015/12/12 14:13:43 Done.
kzar 2015/12/12 14:13:43 Done. (Provisionally, if they disagree on the issu
35 );
36 }
37
38 function onPrefsLoaded()
39 {
40 Prefs.onLoaded.removeListener(onPrefsLoaded);
41 setUninstallURL();
42 }
43
44 // The uninstall URL contains the notification download count as a parameter,
45 // therefore we must wait for preferences to be loaded before generating the
46 // URL and we need to re-generate it each time the notification data changes.
47 Prefs.onLoaded.addListener(onPrefsLoaded);
48 Prefs.onChanged.addListener(function(name)
49 {
50 if (name == "notificationdata")
51 setUninstallURL();
52 });
OLDNEW
« no previous file with comments | « no previous file | metadata.common » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld