Init
This commit is contained in:
29
yt.js
Normal file
29
yt.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user