fixed bug stuck when element not avaible
This commit is contained in:
parent
901ead6691
commit
ac86ac4bd9
@ -49,6 +49,7 @@ function handleMessages(message,sender,sendResponse,tab,data){
|
|||||||
{
|
{
|
||||||
browser.tabs.sendMessage(tab.id,data.subscriptions[i].url);
|
browser.tabs.sendMessage(tab.id,data.subscriptions[i].url);
|
||||||
}
|
}
|
||||||
|
console.log(i);
|
||||||
}
|
}
|
||||||
else if(message === "finished")
|
else if(message === "finished")
|
||||||
{
|
{
|
||||||
|
13
spawn.js
13
spawn.js
@ -31,7 +31,18 @@ function worker(message)
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(message != "Init")//on init only load page
|
if(message != "Init")//on init only load page
|
||||||
{
|
{
|
||||||
document.getElementsByClassName("yt-spec-button-shape-next yt-spec-button-shape-next--filled yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m")[0].click();
|
let element = document.getElementsByClassName("yt-spec-button-shape-next yt-spec-button-shape-next--filled yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m")[0];
|
||||||
|
if (element != null)
|
||||||
|
{
|
||||||
|
element.click();
|
||||||
|
console.log("elements found");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
console.log("element not found, already in Abo");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(message);
|
console.log(message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user