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

Delta Between Two Patch Sets: firstRun.js

Issue 29573083: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Left Patch Set: Remove check for window.browser Created Oct. 13, 2017, 4:59 a.m.
Right Patch Set: Add polyfill.js to README.md Created Oct. 17, 2017, 12:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « firstRun.html ('k') | i18n.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 getDocLink("acceptable_ads_criteria", (link) => 48 getDocLink("acceptable_ads_criteria", (link) =>
49 { 49 {
50 setLinks("acceptable-ads-explanation", link, openFilters); 50 setLinks("acceptable-ads-explanation", link, openFilters);
51 }); 51 });
52 52
53 getDocLink("contribute", (link) => 53 getDocLink("contribute", (link) =>
54 { 54 {
55 setLinks("share-headline", link); 55 setLinks("share-headline", link);
56 }); 56 });
57 57
58 chrome.runtime.sendMessage({ 58 browser.runtime.sendMessage({
59 type: "app.get", 59 type: "app.get",
60 what: "issues" 60 what: "issues"
61 }, (issues) => 61 }, (issues) =>
62 { 62 {
63 // Show warning if filterlists settings were reinitialized 63 // Show warning if filterlists settings were reinitialized
64 if (issues.filterlistsReinitialized) 64 if (issues.filterlistsReinitialized)
65 { 65 {
66 E("filterlistsReinitializedWarning").removeAttribute("hidden"); 66 E("filterlistsReinitializedWarning").removeAttribute("hidden");
67 setLinks("filterlistsReinitializedWarning", openFilters); 67 setLinks("filterlistsReinitializedWarning", openFilters);
68 } 68 }
69 }); 69 });
70 70
71 updateSocialLinks(); 71 updateSocialLinks();
72 72
73 ext.onMessage.addListener((message) => 73 ext.onMessage.addListener((message) =>
74 { 74 {
75 if (message.type == "subscriptions.respond") 75 if (message.type == "subscriptions.respond")
76 { 76 {
77 updateSocialLinks(); 77 updateSocialLinks();
78 } 78 }
79 }); 79 });
80 chrome.runtime.sendMessage({ 80 browser.runtime.sendMessage({
81 type: "subscriptions.listen", 81 type: "subscriptions.listen",
82 filter: ["added", "removed", "updated", "disabled"] 82 filter: ["added", "removed", "updated", "disabled"]
83 }); 83 });
84 } 84 }
85 85
86 function updateSocialLinks() 86 function updateSocialLinks()
87 { 87 {
88 for (let network of ["twitter", "facebook", "gplus"]) 88 for (let network of ["twitter", "facebook", "gplus"])
89 { 89 {
90 let link = E("share-" + network); 90 let link = E("share-" + network);
(...skipping 16 matching lines...) Expand all
107 event.preventDefault(); 107 event.preventDefault();
108 108
109 getDocLink(event.target.id, (link) => 109 getDocLink(event.target.id, (link) =>
110 { 110 {
111 openSharePopup(link); 111 openSharePopup(link);
112 }); 112 });
113 } 113 }
114 114
115 function openFilters() 115 function openFilters()
116 { 116 {
117 chrome.runtime.sendMessage({type: "app.open", what: "options"}); 117 browser.runtime.sendMessage({type: "app.open", what: "options"});
118 } 118 }
119 119
120 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 120 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
121 }()); 121 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld