mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 05:08:00 +02:00
mediaSession Controls
This commit is contained in:
parent
8ee03fa623
commit
ab076dc47d
5 changed files with 65 additions and 47 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue