better event listener on to send url to addon

This commit is contained in:
simon 2022-04-01 14:44:11 +07:00
parent beccfd47a7
commit 04e8d7d2cb
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 9 additions and 6 deletions

View File

@ -6,12 +6,6 @@ console.log("running script.js");
let browserType = getBrowser();
setTimeout(function(){
console.log("running setimeout")
sendUrl();
return false;
}, 2000);
// boilerplate to dedect browser type api
function getBrowser() {
@ -45,3 +39,12 @@ function sendUrl() {
});
};
document.addEventListener("yt-navigate-finish", function (event) {
console.log("running setimeout")
setTimeout(function(){
sendUrl();
return false;
}, 2000);
});