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