Skip to content

Commit 3c10bf5

Browse files
committed
V2.1.1
1 parent a87a3c9 commit 3c10bf5

File tree

5 files changed

+51
-29
lines changed

5 files changed

+51
-29
lines changed

manifest.chromium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Steam Web Integration",
33
"description": "Integrate your personal Steam information on the web, at your convenience!.",
44
"homepage_url": "https://github.com/revadike/steamwebintegration",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"author": "Revadike",
77
"manifest_version": 3,
88
"action": {

manifest.firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Steam Web Integration",
33
"description": "Integrate your personal Steam information on the web, at your convenience!.",
44
"homepage_url": "https://github.com/revadike/steamwebintegration",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"author": "Revadike",
77
"browser_specific_settings": {
88
"gecko": {

package-lock.json

Lines changed: 37 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "steamwebintegration",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Integrate your personal Steam information on the web, at your convenience!",
55
"main": "manifest.json",
66
"type": "module",
@@ -27,6 +27,6 @@
2727
"devDependencies": {
2828
"@babel/eslint-parser": "^7.19.1",
2929
"crx": "^5.0.1",
30-
"eslint": "^8.34.0"
30+
"eslint": "^8.35.0"
3131
}
3232
}

scripts/background.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async function getData() {
222222

223223
console.log(`[Steam Web Integration] Refreshing '${task.key}' data`);
224224
data[task.key] = await task.promise().catch((error) => {
225-
console.error(error);
225+
console.error(`[Steam Web Integration] Error while refreshing '${task.key}' data:`, error);
226226
return data[task.key];
227227
});
228228
data.lastCached[task.key] = Date.now();
@@ -236,27 +236,32 @@ async function getData() {
236236
return data;
237237
}
238238

239-
async function onMessage(message) {
239+
function onMessage(message, sender, sendResponse) {
240240
console.log("[Steam Web Integration] Received message: ", message);
241241
switch (message.action) {
242242
case "getData":
243243
dataPromise = dataPromise || getData();
244-
return dataPromise;
244+
dataPromise.then((data) => sendResponse(data));
245+
break;
245246
case "getSettings":
246-
return getSettings();
247+
getSettings().then((settings) => sendResponse(settings));
248+
break;
247249
case "runSWI":
248250
case "reloadSWI":
249251
case "clearSWI":
250-
return chrome.tabs.query({
252+
chrome.tabs.query({
251253
"active": true,
252254
"currentWindow": true,
253255
}, (tabs) => {
254256
let myTabId = tabs[0].id;
255257
chrome.tabs.sendMessage(myTabId, message);
256258
});
259+
sendResponse(true);
260+
break;
257261
default:
258262
throw new Error("Unknown message action");
259263
}
264+
return true;
260265
}
261266

262267
chrome.runtime.onMessage.addListener(onMessage);

0 commit comments

Comments
 (0)