random id

This commit is contained in:
Roy Olav Purser 2022-03-05 20:33:15 +01:00
parent 108de113d1
commit cd5894429c
Signed by: roypur
GPG Key ID: E14D26A036F21656
2 changed files with 10 additions and 4 deletions

View File

@ -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"],

View File

@ -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