random id
This commit is contained in:
parent
108de113d1
commit
cd5894429c
@ -7,7 +7,7 @@
|
|||||||
"48": "icon-48.png",
|
"48": "icon-48.png",
|
||||||
"128": "icon-128.png"
|
"128": "icon-128.png"
|
||||||
},
|
},
|
||||||
"version": "106.0",
|
"version": "107.0",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"host_permissions": ["http://127.0.0.1:4000/jsonrpc"],
|
"host_permissions": ["http://127.0.0.1:4000/jsonrpc"],
|
||||||
"permissions": ["tabs"],
|
"permissions": ["tabs"],
|
||||||
|
@ -5,6 +5,12 @@ providers.set("youtu.be", "youtube")
|
|||||||
providers.set("tv.nrk.no", "nrk")
|
providers.set("tv.nrk.no", "nrk")
|
||||||
providers.set("seafile.purser.it", "seafile")
|
providers.set("seafile.purser.it", "seafile")
|
||||||
|
|
||||||
|
const random = () => {
|
||||||
|
const arr = new Uint8Array(32)
|
||||||
|
window.crypto.getRandomValues(arr)
|
||||||
|
return btoa(arr)
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
let [proxyButton, kodiButton] = document.getElementsByTagName("button")
|
let [proxyButton, kodiButton] = document.getElementsByTagName("button")
|
||||||
proxyButton.addEventListener("click", (ev) => {
|
proxyButton.addEventListener("click", (ev) => {
|
||||||
@ -50,13 +56,13 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
newurl.pathname = oldurl.pathname
|
newurl.pathname = oldurl.pathname
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newurl.search = search.toString()
|
newurl.search = search.toString()
|
||||||
|
|
||||||
let req = {
|
let req = {
|
||||||
jsonrpc: "2.0",
|
jsonrpc: "2.0",
|
||||||
method: "Player.Open",
|
method: "Player.Open",
|
||||||
id: 12345,
|
id: random(),
|
||||||
params: {
|
params: {
|
||||||
item: {
|
item: {
|
||||||
file: newurl.href
|
file: newurl.href
|
||||||
|
Loading…
Reference in New Issue
Block a user