Personal tools

Bookmarklet

From Social Patterns

Jump to: navigation, search

Contents

Example

3306044782_a672bd4a14_o.png
Facebook invites its users to install a bookmarklet for sharing content on their site from around the web.

What

A bookmarklet is a small computer application, usually written in Javascript, and stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are designed to add one-click functionality to a browser or web page. When clicked, a bookmarklet performs some function, one of a wide variety such as a search query or data extraction. The term is a combination of the terms bookmark and applet.

When

Bookmarklets work well for dedicated users already in the habit of sharing and looking for more convenient ways to do so, but they may also work for recruiting new sharers, if well presented (otherwise, first-time use of a bookmarklet tends to be rather unintuitve.

How

Web browsers use URIs for the href attribute of the <A> tag and for bookmarks. The first part of the URI, such as http:, file:, or ftp:, specifies the protocol and required form for the rest of the string. Browsers also implement a prefix javascript: that to a parser is just like any other URI. Internally, the browser sees that the protocol is javascript, treats the rest of the string as javascript code which is then executed, and uses the resulting string as the new page.

The executing script has access to the current page, which it may inspect and change. If the script returns an undefined type rather than a string, the browser will not load a new page, with the result that the script simply runs against the current page content. This permits in-place font size and color changes, for example, without a page reload.

"Installation of a bookmarklet" is performed by creating a new bookmark, and pasting the code into the URL destination field. The bookmarklet can then be run by loading the bookmark normally, or dragged to the browser's bookmark toolbar.

Extensible browser plugins such as the Delicious add-on for Firefox represent a more sophisticated approach to the bookmarklet concept:

3305244709_714a70ea10_o.png
The Delicious add-on for Firefox is like a bookmarklet on steroids.

Why

Bookmarklets make sharing easier, thus reducing the friction for the user and facilitating more activity on the network.

Related Patterns

As Seen On

  • Delicious
  • Facebook
  • blog software
  • Twit This

Sources / Similar Patterns in Other Libraries

Resources
Information