30 lines
642 B
JavaScript
30 lines
642 B
JavaScript
|
document.body.style.border = "5px solid red";
|
||
|
|
||
|
const filePath = "newpipe_subscriptions_202403101004.json";
|
||
|
|
||
|
var localURL = browser.extension.getURL(filePath);
|
||
|
|
||
|
var w=[];
|
||
|
fetch(localURL)
|
||
|
.then((res) => {
|
||
|
if(!res.ok){
|
||
|
throw new Error
|
||
|
(`res error`);
|
||
|
}
|
||
|
return res.json();
|
||
|
})
|
||
|
.then((data) => {
|
||
|
|
||
|
for(let i=0;i<3;i++) //i in data.subscriptions)
|
||
|
{
|
||
|
let open=null;
|
||
|
console.log(data.subscriptions[i].url);
|
||
|
try{
|
||
|
open = alert(data.subscriptions[i].url,"_blank");
|
||
|
}
|
||
|
catch(e) {InsertError(e.description);}
|
||
|
}
|
||
|
})
|
||
|
.catch((error)=> console.error("couldnt fetch data",error));
|
||
|
|