Skip to content

Instantly share code, notes, and snippets.

@kattak
Last active January 9, 2017 00:22
Show Gist options
  • Save kattak/db5585b8471f18e0a00fd936ec9dcf99 to your computer and use it in GitHub Desktop.
Save kattak/db5585b8471f18e0a00fd936ec9dcf99 to your computer and use it in GitHub Desktop.
Hello World Bookmarklet - What is a bookmarklet? Why would I want to use one? Make a "Hello World" bookmarklet in <10 minutes.

##Bookmarklets

#####What is it?

  • An anonymous JS function
  • Saved in the url of a bookmark in your browser
  • Can also reference an external file

#####What can it be used for?:

  • Hide the subscription blocker on NYT
  • Fill in forms for you
  • Idle Games
  • Download a YouTube video
  • Accept all gifts in a Facebook game

See more

#####Hello World Bookmarklet

  1. Make your bookmarks bar visible: In Chrome > View > Always Show Bookmarks Bar ss

  2. Add a new bookmarklet Right click on your Bookmarks Bar > Add Page

  3. Edit your bookmarklet (The fields will be autofilled with the title and url of your current page)

Edit the title and url and then save it. Be careful - spaces are important!

javascript:(function(){ alert("herrow world") }) ()

  1. Click on your bookmarklet "HERROW!!"

  1. (Optional) If the above steps aren't working for you, try the Bookmarklet Crunchinator site.
    It will wrap your JS code in an anonymous function as well as doing other formatting for you.

-Click on the "Your Bookmarklet" link to test it. -Then, drag the 'Your Bookmarklet' link to your bookmarks bar. -Click on it to run it.

Bookmarklet Crunchinator

#####Why use a bookmarket instead of an extension?

  • Doesn't give external devs access to your browser "your personal information, and all pages you visit"

#####Helpful links Bookmarklet Crunchinator | TutsPlus - Tutorial | Make your own bookmarklets with JQuery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment