

Writing Browser Extensions - Comparing Firefox, Chrome and Opera - zackattack
http://blog.nparashuram.com/2011/10/writing-browser-extensions-comparing.html?hn

======
simonster
This is really just about writing a browser extension that injects code into a
page and does nothing else. Firefox extensions can do all sorts of things
(modify the browser UI, call functions in system libraries, create protocol
handlers, perform raw IO) that other environments don't permit.

Many of these things probably can't be done through Jetpack/Add-on SDK, but,
for better or for worse, Firefox's extension mechanism is vastly more powerful
than that of Chrome or Opera.

~~~
jaredsohn
It is true that Firefox's extension mechanism is more powerful than Chrome or
Opera. However, some of the things that you list (such as calling functions in
system libraries and performing raw IO) can be done in Chrome and I think in
Opera by creating an NPAPI extension in C/C++.

Edit: I realize it is harder to write it this way. It is also harder to write
Firefox extensions in C/C++ instead of in their JavaScript APIs. The point is
that some things not possible in other browsers' JavaScript APIs are possible
if you create NPAPI extensions (although some things such as certain UI
flexibility are only available in Firefox.)

Edit: You can also register protocol handlers via JavaScript, although they
need to start with the string 'web+' which makes this less powerful than what
is possible in Firefox.

~~~
zbuc
NPAPI is _difficult_. I couldn't find a working sample project(though I only
spent a couple hours) last year when I wanted to try it out.

It sounds like Google is working on a new plugin architecture in JS + HTML
that will support the deep interactivity of NPAPI, so we'll see...

~~~
rohitnair
Google already uses the new Pepper Plugin API[1] in the current versions of
Chrome. They've also switched projects like Native Client to use this new API
instead of NPAPI. PPAPI definitely seems better based on my experience of
writing a few Native Client modules.

[1] - <http://code.google.com/p/ppapi/>

~~~
zbuc
Wow, good tip, thanks!

------
swang
I know this is off-topic but I need to rant against Google/Blogger's mobile
version of their platform since I keep running into it whenever I'm browsing
HN on my iPhone.

When I view this article on an iPhone 4S, Blogger adds in a swipe feature that
goes to the next article (or previous article if you swipe left).

This "feature" is driving me nuts because there are tables that break the
screen on the iPhone where I cannot move around to view it because Blogger
automatically assumes I want to read the next article.

If someone from Google is reading this, or even better Blogger. Please take
this feature out. It is a really annoying experience.

~~~
benologist
Every attempt I've seen to turn something into a special mobile version has
failed horribly. Google Images is absolute, pure shit, I literally get up and
find my laptop when I have to use Images because they've made it so horrible
to use. And of course OnSwipe lol.

I don't want an "ipad" experience, I just want the website.

~~~
andrewmunn
If you have a moment, I'd love to know what you dislike about Google Images
for iPad. I worked on the product when I was an intern at Google. I'm sorry
it's causing you frustration :(

~~~
benologist
#1 hate is I can't open images or pages in new tabs, if I tap and hold on the
outer thumb I just get the option to save that thumb, if I tap and hold on the
link in the preview I get nothing at all. That makes browsing multiple images
painful.

#2 is to view the meta data that's "free" on normal GI you have to click
through to the preview and start downloading it and other images at a larger
size. Images has lots of shitty, spammy websites gaming the results as well as
poor versions of images available elsewhere larger, seeing that info was
always useful to me.

~~~
andrewmunn
Thanks for the feedback! Both of your grievances are legitimate issues. The
reason why we didn't support those use cases on iPad is because they are power
user features.

Pro tip: If you scroll to the bottom of the page, you can view the desktop
site by hitting "Classic". Happy Googling :)

~~~
8ig8
When I scroll to the bottom of the page on my iPad, Google _conveniently_
loads more images. It's like a cruel joke.

------
jaredsohn
If you want to create a cross-browser extension, you can use an API such as
Kynetx, Webmynd, CrossRider, or KangoExtensions. Links and pros/cons can be
found here: [http://stackoverflow.com/questions/4913123/cross-browser-
ext...](http://stackoverflow.com/questions/4913123/cross-browser-extensions-
api)

~~~
aantix
I've been building an extension with Kango and so far everything has worked as
advertised. The build process is a snap. Everything is written in Javascript;
I have complete access to the DOM via Jquery. Builds for FF, Chrome and Opera.
And their support has been quite responsive.

The only downside is that for IE build support you have to buy a commercial
license which isn't cheap ($2500).

------
tonetheman
Last time I looked it was a maze trying to figure out FF extensions. A painful
long learning curve. I wrote my first chrome/safari extension about 5 mins
after I read the intro.

~~~
gkoberger
Firefox Add-ons PM here. I completely agree. I'm a developer, however I had to
have someone from the SDK team show me how to get started since it was so hard
to find proper documentation.

I'm currently working on completely redoing the Developer Hub to make it dead
simple. Shoot me an email (gkoberger at mozilla dot com) if you have any
suggestions or things that were particularly painful.

~~~
fpp
start with the documentation on creating a FF debug version e.g. on Windows
64bit - it does not even work with the config files from the trunk - leaving
alone the different flavors of documentation you find on Mozilla dev - have a
look how Google has done this - and yes you have to describe how to setup the
environment for e.g. VS2008 SP1 (again have a look at how Google has
documented it)

Grrrrrrrrrrrrrrrrrrrr - I'm still furious if I remember the days and nights
wasted with false or outdated documentation.

At the end we skipped using FF (our original favorite) for these internal
tasks and went along with Chrome - sadly to say so but this is currently
broken with FF and great if that changes.

------
vetler
Speaking of Opera, there's a labs release out that supports extensions on
Opera Mobile: [http://dev.opera.com/articles/view/extensions-opera-
mobile-l...](http://dev.opera.com/articles/view/extensions-opera-mobile-labs/)

------
Zaheer
I love how they don't even mention IE!

~~~
jaredsohn
IE's JavaScript support for creating extensions is really poor.

~~~
axemclion
Really hoping that IE comes up with something similar !!

------
jusob
Chrome, Opera and Safari have a very similar extension architecture. If very
easy to port on extension to the other 2 borwsers, as long as: * the API is
there. For example only chrome can block HTTP requests, and access headers. *
The UI element is there. Safari has no page action, for example

