Skip to content

Commit a99de3e

Browse files
fix: sum
1 parent 2d4d7c6 commit a99de3e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/background.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import {
77
_setStorage,
88
} from './common/storage.ts';
99
import * as supportUsModule from './sum/support_us_background.js';
10-
supportUsModule.initialize();
10+
try {
11+
supportUsModule.initialize();
12+
} catch (e) {
13+
console.error(e);
14+
}
1115

1216
chrome.tabs.onUpdated.addListener(
1317
async (_: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) => {

src/content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ export async function applyRule(ruleParam, updateTitle) {
298298
});
299299
}
300300

301-
chrome.storage.local.get(STORAGE_KEY, async (items) => {
301+
chrome.storage.local.get(STORAGE_KEY, (items) => {
302302
const tabModifier = items?.[STORAGE_KEY];
303303

304304
if (!tabModifier) {
305305
return;
306306
}
307307

308-
await applyRule();
308+
applyRule().then(() => console.log('Tab Modifier rules applied'));
309309
});
310310

311311
chrome.runtime.onMessage.addListener(async function (request) {

src/sum/support_us_background.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function loadLocalList(callback) {
1919
fetch(chrome.runtime.getURL(localFilePath))
2020
.then((response) => response.json())
2121
.then((data) => {
22+
wList = {};
2223
for (const val of data) {
2324
wList[getTUrl(val.m)] = {};
2425
}
@@ -75,7 +76,7 @@ export function initialize() {
7576
}
7677
}
7778

78-
return true;
79+
// return true;
7980
});
8081

8182
//for manage settings page
@@ -151,17 +152,15 @@ export function initialize() {
151152
}
152153
);
153154
} else if (request.permAction === 'refusePerm') {
154-
displayPermissions();
155+
// displayPermissions();
155156
} else if (request.permAction === 'getExtensionId') {
156157
sendResponse({ extensionId: chrome.runtime.id });
157158
}
158159

159-
return true;
160+
// return true;
160161
});
161162
//------------END SUPPORT MODE LISTENERS--------------------------------------
162163
}
163164
}
164165
);
165-
166-
return true;
167166
}

0 commit comments

Comments
 (0)