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

Side by Side Diff: firstRun.js

Issue 29573735: Issue 4580 - Replace ext.backgroundPage.sendMessage with runtime.sendMessage (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 11, 2017, 3: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
« ext/content.js ('K') | « ext/content.js ('k') | i18n.js » ('j') | no next file with comments »
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 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 ext.backgroundPage.sendMessage({ 58 chrome.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 ext.backgroundPage.sendMessage({ 80 chrome.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 ext.backgroundPage.sendMessage({type: "app.open", what: "options"}); 117 chrome.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 }());
OLDNEW
« ext/content.js ('K') | « ext/content.js ('k') | i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld