Remove unused variables.
This commit is contained in:
ccppi 2024-05-08 13:43:29 +00:00
parent 3d3a276dd5
commit d1ed7befbc

View File

@ -2,27 +2,15 @@ let backgroundPage = browser.extension.getBackgroundPage();
var data;
let i=0;
/*
data = readUrl()
.then(function(data){
browser.browserAction.onClicked.addListener(function(event1){
browser.tabs.create({"url": "home.html"},function(tab){
browser.runtime.onMessage.addListener(function(request,sender,sendResponse){
handleMessages(request,sender,sendResponse,tab,data);
});
});
});
});
*/
browser.browserAction.onClicked.addListener(function(event1){
browser.browserAction.onClicked.addListener(function(event1){
browser.tabs.create({"url": "home.html"},function(tab){
browser.runtime.onMessage.addListener(function(request,sender,sendResponse){
handleMessages(request,sender,sendResponse,tab);
});
});
});
});
function handleMessages(message,sender,sendResponse,tab){
if(message === "Button_clicked")
{
browser.tabs.executeScript(tab.id,{
@ -34,7 +22,6 @@ function handleMessages(message,sender,sendResponse,tab){
else if(message === "Content_Loaded")
{
console.log("Background: Received Content_Loaded");
// nextUrl(data,tab,i);
if(i===0)
{
browser.tabs.sendMessage(tab.id,"Init");
@ -73,7 +60,7 @@ function handleMessages(message,sender,sendResponse,tab){
}
}
}
//----depreacted -vv
function readUrl()
{
let data;
@ -88,7 +75,7 @@ function readUrl()
return res.json();
})
.then((data) => {
for(let i=0;i<i;i++) //i in data.subscriptions)
for(let i=0;i<i;i++) //wtf why does this work?
{
let open=null;
console.log(data.subscriptions[i].url);