

Chrome Extension Development, By Practical Example - BenjaminCoe
https://github.com/bcoe/DoloresLabsTechTalk

======
bsimpson
The problem with extension development is that each browser does it
differently.

If you abstract away the browser-specific API, it's not too hard to write a
cross-browser extension. Here's one that runs on both Chrome and Safari:

[http://code.google.com/p/marking-menu-
js/source/browse/#svn%...](http://code.google.com/p/marking-menu-
js/source/browse/#svn%2Ftrunk)

Notice how it implements the important bits of Chrome's extension API in terms
of Safari's:

[http://code.google.com/p/marking-menu-
js/source/browse/trunk...](http://code.google.com/p/marking-menu-
js/source/browse/trunk/safari/hostAPI.js)

That allows you to easily port Chrome extensions over.

~~~
candeira
It seems to me there is a need for a browser extension framework/polyfill that
allows you to write code once, deploy to any browser. Would that even be
possible?

------
atdt
Hey, cool! The source code for my Chrome extension is also on GitHub:

[https://github.com/atdt/chrome-force-media-
type/blob/master/...](https://github.com/atdt/chrome-force-media-
type/blob/master/Makefile)

The Makefile might be interesting to you. It's very simple, but it automates
an annoying part of the development cycle.

~~~
jugglinmike
Throwing mine out there, too--for spoofing your user-agent string:

<https://github.com/jugglinmike/chrome-user-agent>

~~~
paulirish
Hey Mike, just FYI this is now available in DevTools:
<http://cache.gyazo.com/1c4bc26914b409a85884147d6f9fec03.png>

------
zobzu
"Why Create a Chrome Extension?

    
    
        It's a great way to integrate seamlessly with a third-party site like Gmail.
            It in turn solves the "other site" problem, i.e., your customers don't want to go to yet another website.
        The Chrome Web Store is a wonderful source of traffic.
        All your friends are doing it.

"

i find the readme scary. it encourages closing the web.

the rest's good - but - the intention's bad.

~~~
BenjaminCoe
I agree in principal -- I'm not advocating that the whole internet be
centralized to a few major websites. Having said that, integrating with a site
like Gmail can be a good way for a small fish to get some traction.

