Bookmarklets and Javascript – A powerful combination


Do me a favor: copy the line of text below and paste it into your browser’s address bar and press Enter.

javascript:alert("Holy Moly! I can run code in this thing!");


Whoa! What just happened? Javascript. That’s what. And that’s all it takes to make those magical things called bookmarklets give you an awesome (and convenient!) web experience.

I love bookmarklets. Even before things like Instapaper came along and the term ‘bookmarklets’ became part of the common tech enthusiast’s vernacular, I was nerding out on them. They are a sheer celebration of Javascript. Other programming languages don’t even get the chance to come play in this space. It’s a place where Javascript and its exotic dance with the DOM truly shine. (If you can’t tell, I’m totally gleaming with frontend development pride right now…)

My favorite thing about bookmarklets is that I have the opportunity for little apps I build to essentially interact with any web page in the world. There’s something very powerful and liberating about that as a developer. And there’s also something very powerful and personal about that as an everyday user. During a time when mobile apps and niche online communities are segregating content and activities on the Web, bookmarklets are opening content up in a new way. I can now use a bookmarklet to scrape content from this very page you’re reading and move it somewhere else. I can take this page and tag it with words and ideas that are meaningful to me. I can even kill every single node on this page in Asteroids-like fashion.

Undoubtedly, bookmarklets change our relationship with content on the web. This idea is summed up nicely in Cameron Koczon’s article on Orbital Content. What’s more, standardized microformats allow bookmarklets to know more about the content you’re looking at and act accordingly. Viewing a video? A recipe? A book? Bookmarklets like SpringPad will know and scrape the right content and format it in ways that make sense for future consumption. Looking at a product that you love? Why not Fancy it or add it to Svpply with their handy bookmarklets and watch as crowd curation decides how awesome that product really is.

And just think of all the possibilities for bringing your social communities along with you as you traverse the Web. We all should be excited. VERY excited.

So now that you’re overwhelmed with awe and are feeling the urge to give fellow bookmarklet lovers a high five, I want to raise some new questions and challenges I see us facing as bookmarklets continue to gain popularity. What happens to content when bookmarklets disperse it and take it out of context? What happens to the original source that served up the content to begin with? Should content strategists start considering how bookmarklets might be ‘looking’ at their content? Should developers start considering that? Once content from your page is shared and being viewed from elsewhere on the web, how can you convert that viewership back to your own site? And that’s just content.

What about how bookmarklets function in general? How can sites track if bookmarklets are used on their pages? Will there eventually be bookmarklet best practices that allow bookmarklets to identify themselves to pages they’re acting on? And what about browsers? Will they evolve to house bookmarklets in a more elegant way than simply a long thin bar across the top of my browser? And how can they be made more accessible in mobile browsers?

That’s a lot of stuff! So where do we start? As developers, we start by making even more bookmarklets and pushing the envelope for what they can do. At R/GA specifically, this means finding creative ways to allow users to bring our client’s brands to pages they visit across the web.

But it’s not just about bookmarklets. It’s also about building solid websites that work with bookmarklets. We need to start considering how we can build web pages to make bookmarklets feel more welcome while also making sure they don’t take complete advantage of the page. Sometimes bookmarklets are so powerful that they can almost pose a threat to the sites they’re functioning on – making their content and features more appealing than the actual site the user is looking at. When our neighbor Mr. Bookmarklet from upstairs comes down asking to borrow a cup of sugar from our web page, we should gladly give him a cup while also keeping enough ingredients in our pantry to bake a delicious website pie that no bookmarklet could ever cook on its own.

As technologies continue to move toward HTML5 and Javascript, I foresee bookmarklets becoming more powerful, prevalent, and better integrated with browsers…So how will we be challenging this space?