Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Bookmarklet #6

Open
ben-miles opened this issue Mar 9, 2024 · 2 comments
Open

Make Bookmarklet #6

ben-miles opened this issue Mar 9, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ben-miles
Copy link
Owner

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 ben-miles self-assigned this Mar 9, 2024
@ben-miles ben-miles added the enhancement New feature or request label Mar 9, 2024
@ben-miles
Copy link
Owner Author

ben-miles commented Mar 9, 2024

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
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant