javascript:(function()%7Bconst url = String(window.location); if (!url.includes('youtube')) %7B alert ('Use this bookmark on a YouTube tab, please.'); return; %7D open('https://annotate.tv/new?url=%27 + url); %7D)()
I don't know if there is something I need to remove or add to the above script?
Basically, I want to press a button on my Elgato Stream Deck, when I begin to watch a YouTube video and have it take me to Annotate.tv's site where I can take notes. Possible?
I chose Execute JavaScript in Google Chrome as the action and pasted the above.
Help?
It's essentially what this video is showing except I want the bookmark to be a button on my Stream Deck:
Keyboard Maestro can handle this sort of stuff with ease, and you don't have to understand JavaScript.
On the other hand – if you just must use JavaScript then it'd be something close to this:
(() => {
const url = String(window.location);
if ( ! url.includes('youtube') ) {
alert ('Use this bookmark on a YouTube tab, please.');
return;
}
open('https://annotate.tv/new?url=' + url);
})();
I had to turn OFF pop-up blocking for YouTube in Google Chrome for this script to work, and I can't completely verify it due to the log-in necessary at Annotate.tv.