Added lukes button and made good
This commit is contained in:
parent
5417618084
commit
19cb309d58
@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
"matches": ["*://*.youtube.com/*"],
|
"matches": ["*://*.youtube.com/*", "*://*.youtu.be/*"],
|
||||||
"js": ["test.js"]
|
"js": ["test.js"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
4
test.js
4
test.js
@ -2,6 +2,8 @@ function getTime() {
|
|||||||
// Youtube can get fucked, this is the worst way I can get this to work -_-
|
// Youtube can get fucked, this is the worst way I can get this to work -_-
|
||||||
// console.log("Why does this not fucking work");
|
// console.log("Why does this not fucking work");
|
||||||
let url = window.location.href;
|
let url = window.location.href;
|
||||||
|
url = url.split("&t")[0];
|
||||||
|
url = url.split("&start")[0];
|
||||||
let d = document.querySelector(".video-stream");
|
let d = document.querySelector(".video-stream");
|
||||||
return url + "&t=" + Math.ceil(d.currentTime);
|
return url + "&t=" + Math.ceil(d.currentTime);
|
||||||
}
|
}
|
||||||
@ -30,7 +32,7 @@ function postURL(url) {
|
|||||||
.catch((err) => console.log(err));
|
.catch((err) => console.log(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
ele = document.createElement("p");
|
ele = document.createElement("button");
|
||||||
text = document.createTextNode("Save Timestamp");
|
text = document.createTextNode("Save Timestamp");
|
||||||
ele.addEventListener("click", () => postURL(getTime()));
|
ele.addEventListener("click", () => postURL(getTime()));
|
||||||
ele.appendChild(text);
|
ele.appendChild(text);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user