diff --git a/chrome/manifest.json b/chrome/manifest.json index e6da87b..3b1735d 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -7,7 +7,7 @@ "48": "icon-48.png", "128": "icon-128.png" }, - "version": "106.0", + "version": "107.0", "manifest_version": 3, "host_permissions": ["http://127.0.0.1:4000/jsonrpc"], "permissions": ["tabs"], diff --git a/chrome/script.js b/chrome/script.js index f24433a..60aaa17 100644 --- a/chrome/script.js +++ b/chrome/script.js @@ -5,6 +5,12 @@ providers.set("youtu.be", "youtube") providers.set("tv.nrk.no", "nrk") providers.set("seafile.purser.it", "seafile") +const random = () => { + const arr = new Uint8Array(32) + window.crypto.getRandomValues(arr) + return btoa(arr) +} + document.addEventListener("DOMContentLoaded", () => { let [proxyButton, kodiButton] = document.getElementsByTagName("button") proxyButton.addEventListener("click", (ev) => { @@ -50,13 +56,13 @@ document.addEventListener("DOMContentLoaded", () => { newurl.pathname = oldurl.pathname } } - + newurl.search = search.toString() - + let req = { jsonrpc: "2.0", method: "Player.Open", - id: 12345, + id: random(), params: { item: { file: newurl.href