BookMArkLet vS Chrome plugins

I spend quite a bit of time researching bookmarklets and specific browser plugins in particular chrome plugins. Below my notes on how to get started and what my conclusions where of when to use the different technologies.

Bookmarklets

Let’s start first with the bookmarklet’s since they are the older technology. Basically is an anchor that runs javascript and allows you to execute javascript on the page it is. If you bookmark this anchor it means that you can have a piece of javascript on whatever page the user is browsing which is really useful if you want to do dom sensitive operations. Like for example reacting to a specific page and provide an ui or adding a button to the netflix web interface(someone did that).  Let’s look at a small example if we add this to a link it will let us create a quick target link for geni.us the place I work.

javascript:location.href=’http://target.georiot.com/Proxy.ashx?GR_URL=’+encodeURIComponent(location.href)

Click me

You are going to end in the bad link page because my blog is not something valid to process. With that said if you go to amazon.com you will see it process thru.

For Bookmarlets over the years the capabilities for have increased with the ability to add libraries and your custom javascript files into the bookmarklet. Additionally they currently got support on every browser on the desktop and mobile(at least the big 3’s). So in conclusion they are great for:

  • Manipulating the dom.
  • Adding new elements to a page.
  • Cross Browser compatibility.

Below a few links that help. I really recommend using the bookmarlet generator since it trivializes the process of creating a bookmarlet.

Bookmarklet Basics

Bookmarklet Generator

Chrome Plugins

Alright So all the browsers now a day have a plugin system that is proprietary and work by using javascript to call api’s they have exposed in a sandbox. 

The plugins can do all that a bookmarlet can except be cross browser compatible. Additionally to that they provide a few advantages in the case of chrome:

  • Access to the chrome api’s – This allows you to store data, set alarms even capture the desktop has an image. Aditionally they include new api’s so if you need any of these capabilities doing a plugin is a great idea. Documentation
  • They give you access to the store. Bookmarklet’s need to be discovered via someone hitting your site. The plugins by being on the store you can benefit from someone browsing the new arrivals list.
  • You don’t have to click to activate it. Is running on the background so if your experience would benefit from not having a click to start this is the way to go.

In terms of effort required for simple task they are both very straight forward and there is clear documentation on the web.

With that said the not being cross-browser compatible is a really big weakness in terms of maintenance.

How to build a chrome plugin

Leave a Reply