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