Skip to content

Commit 21708af

Browse files
committed
fix: replace window.alert with chrome.notifications API
Signed-off-by: koyashiro <[email protected]>
1 parent cf103e8 commit 21708af

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Diff for: send.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
}
2121

2222
if (!res.ok && method === "PUT") {
23-
window.alert("please start send_vrc_desktop.");
23+
chrome.notifications.create({
24+
type: "basic",
25+
iconUrl: "./icon.png",
26+
title: "send_vrc",
27+
message: "please start send_vrc_desktop.",
28+
});
2429
}
2530
})
2631
.catch((e) => {
@@ -30,7 +35,12 @@
3035
toVRC(url, "PUT");
3136
}
3237
if (method === "PUT") {
33-
window.alert("please start send_vrc_desktop.");
38+
chrome.notifications.create({
39+
type: "basic",
40+
iconUrl: "./icon.png",
41+
title: "send_vrc",
42+
message: "please start send_vrc_desktop.",
43+
});
3444
}
3545
});
3646
};

Diff for: static/manifest.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
"background": {
1414
"service_worker": "send.js"
1515
},
16-
"permissions": ["activeTab", "contextMenus", "clipboardRead", "scripting"],
16+
"permissions": [
17+
"activeTab",
18+
"contextMenus",
19+
"clipboardRead",
20+
"notifications",
21+
"scripting"
22+
],
1723
"host_permissions": ["http://localhost:11400/*"]
1824
}

0 commit comments

Comments
 (0)