mediaSession Controls

This commit is contained in:
Shiny Nematoda 2022-04-16 18:58:42 +05:30
parent 8ee03fa623
commit ab076dc47d
5 changed files with 65 additions and 47 deletions

View file

@ -1,15 +1,19 @@
export function getPipedQuery() {
const papi = new URLSearchParams(location.search).get('pipedapi')
const papi = new URLSearchParams(location.search).get('pipedapi');
if (!papi) {
return ''
return '';
}
return '?pipedapi=' + papi
return '?pipedapi=' + papi;
}
export async function getJson(url) {
const res = await fetch(url).then((res) => res.json()).catch(err => { alert(err) });
const res = await fetch(url)
.then((res) => res.json())
.catch((err) => {
alert(err);
});
if (!res.error) {
return res;
@ -31,4 +35,4 @@ export async function getJsonPiped(path) {
'pipedapi.kavin.rocks';
return await getJson('https://' + root + path);
}
}