ben-miles / playlist-cleaner

Remove all videos from YouTube playlist by Channel Name
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Make Bookmarklet #6

Open ben-miles opened 6 months ago

ben-miles commented 6 months ago

This is the end-goal, so this issue may be open for a while. I want to package this JS up neatly into a bookmarklet and distribute it as such. I've seen web apps that will do this (it's mostly a matter of wrapping the JS in some enclosure, but it'd probably be smart to minify the code as much as possible, too). This may also entail some kind of simple static page to present the bookmarklet and some brief instructions, or maybe that can be handled by this repo's README file.

ben-miles commented 6 months ago

The article Bookmarklets: Automate boring web tasks by Vladimír Zdražil has concise instructions for how to do this...

  1. Wrap the code in an IIFE (Immediately Invoked Function Expression) -- It looks like (function(){ /* your code here */ })()
  2. Prepend that with javascript: to serve as a "pseudo-protocol"
  3. Save that as the URL field in a bookmark in your browser
ben-miles commented 5 months ago

Reading into it more, it might be more accessible to make this into a browser extension instead of a bookmarklet. Most people probably don't understand bookmarklets, and there's some extra work that goes into distributing them, too. Conversely, a browser extension could be more widely and easily distributed via the Chrome / Firefox extension directories.