diff --git a/src/youtube.js b/src/youtube.js index ba33505..6a46654 100644 --- a/src/youtube.js +++ b/src/youtube.js @@ -27,7 +27,7 @@ function peertubeify(query) { }).then(video => { removeVideoLink(); const link = videoLink(video); - document.querySelector('.title').insertAdjacentElement('afterend', link); + document.querySelector('ytd-app').appendChild(link); }); } @@ -59,12 +59,58 @@ function videoLink(video) { const url = watchURL(video.account.host, video.uuid); return htmlToElement(` - - -

- ${video.account.host} -

-
+ `); } @@ -72,11 +118,3 @@ function removeVideoLink() { const existingLink = document.getElementById(LINK_ID); existingLink && existingLink.remove(); } - -function ready(fn) { - if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") { - fn(); - } else { - document.addEventListener('DOMContentLoaded', fn); - } -}