Skip to content

Commit

Permalink
fix: replace window.alert with chrome.notifications API
Browse files Browse the repository at this point in the history
Signed-off-by: koyashiro <develop@koyashi.ro>
  • Loading branch information
koyashiro committed Apr 23, 2022
1 parent cf103e8 commit 21708af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 12 additions & 2 deletions send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
}

if (!res.ok && method === "PUT") {
window.alert("please start send_vrc_desktop.");
chrome.notifications.create({
type: "basic",
iconUrl: "./icon.png",
title: "send_vrc",
message: "please start send_vrc_desktop.",
});
}
})
.catch((e) => {
Expand All @@ -30,7 +35,12 @@
toVRC(url, "PUT");
}
if (method === "PUT") {
window.alert("please start send_vrc_desktop.");
chrome.notifications.create({
type: "basic",
iconUrl: "./icon.png",
title: "send_vrc",
message: "please start send_vrc_desktop.",
});
}
});
};
Expand Down
8 changes: 7 additions & 1 deletion static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"background": {
"service_worker": "send.js"
},
"permissions": ["activeTab", "contextMenus", "clipboardRead", "scripting"],
"permissions": [
"activeTab",
"contextMenus",
"clipboardRead",
"notifications",
"scripting"
],
"host_permissions": ["http://localhost:11400/*"]
}

0 comments on commit 21708af

Please sign in to comment.