Skip to content

Commit ee3e32e

Browse files
committed
edge: Rename RepostConfirmationCancelerTalkClient to RepostConfirmationCanceler
Now it is used not only as a talk client but also to directly close tabs.
1 parent 789d77c commit ee3e32e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

webextensions/edge/background.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ function wildcardToRegexp(source) {
4747
* ]
4848
* }
4949
*/
50-
const RepostConfirmationCancelerTalkClient = {
50+
const RepostConfirmationCanceler = {
5151
cached: null,
5252

5353
init() {
5454
this.cached = null;
5555
this.ensureLoadedAndConfigured();
56-
console.log('Running as RepostConfirmationCancelerTalkClient Talk client');
56+
console.log('Running RepostConfirmationCanceler');
5757
},
5858

5959
async ensureLoadedAndConfigured() {
@@ -183,8 +183,8 @@ const RepostConfirmationCancelerTalkClient = {
183183
console.log('onErrorOccurred:', details);
184184
if (details.error === 'net::ERR_CACHE_MISS') {
185185
const url = details.url;
186-
const config = this.cached;
187186
const tabId = details.tabId;
187+
const config = this.cached;
188188
this.handleURL(config, url, () => {
189189
this.closeTab(tabId);
190190
});
@@ -211,19 +211,19 @@ chrome.alarms.create('poll-config', {'periodInMinutes': ALARM_MINUTES});
211211

212212
chrome.alarms.onAlarm.addListener((alarm) => {
213213
if (alarm.name === 'poll-config') {
214-
RepostConfirmationCancelerTalkClient.configure();
215-
RepostConfirmationCancelerTalkClient.handleAllTabs();
214+
RepostConfirmationCanceler.configure();
215+
RepostConfirmationCanceler.handleAllTabs();
216216
//handleURL for all url in tabs.
217217
}
218218
});
219219

220220
chrome.webRequest.onErrorOccurred.addListener(
221-
RepostConfirmationCancelerTalkClient.onErrorOccurred.bind(RepostConfirmationCancelerTalkClient),
221+
RepostConfirmationCanceler.onErrorOccurred.bind(RepostConfirmationCanceler),
222222
{urls: ["<all_urls>"]}
223223
);
224224

225225
/* Tab book-keeping for intelligent tab handlings */
226-
chrome.tabs.onUpdated.addListener(RepostConfirmationCancelerTalkClient.onTabUpdated.bind(RepostConfirmationCancelerTalkClient));
227-
chrome.webNavigation.onCommitted.addListener(RepostConfirmationCancelerTalkClient.onNavigationCommitted.bind(RepostConfirmationCancelerTalkClient));
226+
chrome.tabs.onUpdated.addListener(RepostConfirmationCanceler.onTabUpdated.bind(RepostConfirmationCanceler));
227+
chrome.webNavigation.onCommitted.addListener(RepostConfirmationCanceler.onNavigationCommitted.bind(RepostConfirmationCanceler));
228228

229-
RepostConfirmationCancelerTalkClient.init();
229+
RepostConfirmationCanceler.init();

0 commit comments

Comments
 (0)