d
This commit is contained in:
parent
2485aab123
commit
fee1b77f1c
@ -17,6 +17,16 @@
|
||||
"background":{
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
"host_permissions":["*://youtube.com/*"]
|
||||
"host_permissions":["*://youtube.com/*"],
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": [
|
||||
"*://youtube.com/*"
|
||||
],
|
||||
"js": [
|
||||
"spawn.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
18
spawn.js
18
spawn.js
@ -2,15 +2,9 @@
|
||||
//1.grant host permission
|
||||
//
|
||||
//
|
||||
browser.runtime.onMessage.addListener(function (message,listener)
|
||||
browser.runtime.onMessage.addListener(() =>
|
||||
{
|
||||
handle(message);
|
||||
});
|
||||
|
||||
//if(number>0)
|
||||
function handle(message)
|
||||
{
|
||||
console.log("inside handler");
|
||||
console.log("inside handler");
|
||||
if(message.state != "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();
|
||||
@ -19,5 +13,11 @@ function handle(message)
|
||||
let url = message.url;
|
||||
console.log(url);
|
||||
window.location.replace(url);
|
||||
// window.location = url;
|
||||
|
||||
});
|
||||
|
||||
//if(number>0)
|
||||
function handle(message)
|
||||
{
|
||||
// window.location = url;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user