Live data from Hacker News

Writing Browser Extensions - Comparing Firefox, Chrome and Opera

blog.nparashuram.com

11–20 of 33 posts

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#11

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.

Firefox's Jetpack extension API (using JavaScript) is very similar to the commonly used Chrome/Safari ones. You were likely looking at documentation for their C++ extension API.

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#13

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 mecha…

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 AP…

You can write NPAPI extensions for Chrome - you might nevertheless not be able to publish them on the Chrome extension directory.

I've been working on extensions for FF and Chrome recently - one of the biggest problems I had and tmk this is still the case (if it has not changed in the last 3 weeks) that it is in the moment extremely complicated to debug FF extension with the latest versions of FF.

Venkman e.a. don't work with these and compiling a 64bit Windows FF debug version (working with the VS debugger) was the only way we found to get towards that. And this for itself is complicated enough (VS2008 SP1) - when you have compiled debug versions of 64bit FF and Chrome you will realize that it is like night and day reg. documentation (up-to-date and consistent), support and effort.

There is a lot the Mozilla guys have to work on in this area (rather sad - if I would have had more time to spend on that I would have certainly contributed something back - maybe later this year).

Note the error in the article: currently (latest FF versions) you can debug Javascript in the browser e.a. but not FF extensions. If you look a bit deeper into the documentation / google it you will find this specifically mentioned. If you want to try it out start Venkman e.a. and try to find your extension code.

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#14

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 mecha…

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 AP…

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...

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#15

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.

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.

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#16
post #8

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 ca…

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.

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#17

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 mecha…

Though many of them can if you use something like this to dig into the browser internals: var {Cc, Ci} = require("chrome");

Then just use "Cc" instead of "Components.classes" and "Ci" instead of "Components.interfaces" for anything that needs them.

For example, the code in the "adding a stylesheet" section of this page ( https://developer.mozilla.org/en/Using_the_Stylesheet_Servic... ) would look like this: var sss = Cc["@mozilla.org/content/style-sheet-service;1"] .getService(Ci.nsIStyleSheetService); var ios = Cc["@mozilla.org/network/io-service;1"] .getService(Ci.nsIIOService); var uri = ios.newURI("chrome://myext/content/myext.css", null, null); sss.loadAndRegisterSheet(uri, sss.USER_SHEET);

(Assuming you actually have a stylesheet registered at "chrome://myext/content/myext.css", you will just have registered it with the stylesheet service, and it will take effect immediately.)

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#18

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.

I completely agree. I recently released my first Chrome extension and I found the documentation and guides to be clear and concise. I'm now looking into creating a Firefox extension and the learning curve has been very painful. I spent an hour or so just going through the Firefox docs and I'm still unsure how to start building an extension.

Re: Writing Browser Extensions - Comparing Firefox, Chrome and Opera

#20

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.

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.

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.

Post reply on HN