

Chrome Gets Plugins: How to Write a Chrome Extension in Three Easy Steps - anuraggoel
http://www.mattcutts.com/blog/write-chrome-extension/

======
m_eiman
It'd be nice if we could use the correct terms for these things. I know that
I'm probably picking nits, but there's a difference between extensions and
plugins.

My simplified definition: plugins run native code, extensions run Javascript.
Flash if a plugin, Firebug in an extension.

~~~
extension
The terms plugin, extension, add-on, widget, drop-in, applet, cram-thru, etc.
have all historically been used interchangeably to mean little more than "lack
of modular design".

Don't expect actual extensibility from Chromium any time soon. If they can't
be bothered to even _plan_ for platform independence
(<http://dev.chromium.org/developers/browser-bootstrapping>) then they don't
have the design wherewithall to retrofit a C++ app with a comprehensive
extension mechanism.

My hope is that a Google-independent fork will start that extracts the nifty
subsystems in Chromium, like process level isolation, and uses them to build a
more thoughtfully architected browser/platform.

~~~
statictype
1) If they had planned for platform independence, they wouldn't have been able
to release _anything_ for a long time.

2) Since Chrome relies heavily on process isolation, I would think that a
_lot_ of the architecture of the browser is tied to the platform. Even the
html rendering pipeline (based on WebKit) runs out-of-band and the rendered
bitmap is send to the browser window via IPC. (I don't work on the team but
from my understanding of someone's comments, this is how it roughly works)

3) Regarding extensibility, I agree that I doubt Google is going to provide
much extensibility of the actual browser _chrome_. Google's interests are in
the web sites themselves and as such, the greasemonkey-like extensions are
what they're probably going to promote. They want to hide the browser
container as much as possible and move the focus to the web page inside it.

~~~
extension
1 & 2) I should hope that a company worth hundreds of millions of dollars and
employing a vast army of the greatest programming minds in the world could
take the time to wrap their platform specific code in an abstraction layer, a
relatively minor task that is now practiced almost universally, or at least
use some of the many mature cross-platform libraries available.

3) If Chrome is to be a platform, it's going to need a shell with a rich
interface to manage multiple applications and allow them to interact with each
other. It's also going to need an ecosystem and the people it needs in that
ecosystem use OSX and Linux. Making it inflexible or "hiding" it are the exact
wrong things to do.

Firefox Greasemonkey scripts are used by power users to make minor tweaks to
specific sites. I don't see how that functionality will further Google's lofty
plans for Chrome. This was a quick hack that nominatively fulfilled a very
popular feature request.

~~~
statictype
> If Chrome is to be a platform, it's going to need a shell with a rich
> interface to manage multiple applications and allow them to interact with
> each other. It's also going to need an ecosystem and the people it needs in
> that ecosystem use OSX and Linux. Making it inflexible or "hiding" it are
> the exact wrong things to do.

I'm certainly not the one in charge of directing Google's vision but it would
seem to logical to me that they are _not_ interested in creating a new
'platform' in the sense that xul is a platform. As far as I can see, the
purpose of Chrome is to promote web apps as a reasonable alternative to
desktop apps.

------
nuclear_eclipse
Still doesn't offer any _real_ extension functionality; it's more a glorified,
built-in version of Greasemonkey. This precludes such popular and useful
Firefox extensions such as Firebug, Foxmarks, AdBlock, or just about any other
extension besides Greasemonkey itself...

~~~
scotth
I'm not sure that's entirely true.

I can imagine AdBlock, as well as other plugins that deal mainly with the DOM,
as entirely possible. I mean, how much does AdBlock really do? Grabs a list of
blacklisted URLs (with wildcards), matches applicable elements in the DOM, and
removes them.

AdBlock may prevent these requests from being issued at all, but that isn't to
say you can't implement something similar in a Greasemonkey-like environment.

~~~
nuclear_eclipse
The whole point of AdBlock is that it _does_ block the actualy requests in the
first place. Why should I have to download 800k of ads for a 200k webpage, and
open myself to adware tracking cookies? Removing them from DOM _after_ they've
been downloaded is not a proper solution to me at all...

~~~
scotth
I disagree. I have an internet plan with 100 gigs of allotted transfer. I
don't care if a few kb here and there come down. I understand that your
position may be different, but in my opinion most use Adblock the way I do --
to not see advertisements.

~~~
nuclear_eclipse
Transfer totals has no bearing on bandwidth _speed_. When I'm on wireless
connections, or at work where I am forced to work from a connection shared
with 400 other employees, the bandwidth required by ads actually takes up a
significant amount of time. I don't even have _any_ caps on my usable
bandwidth, in any of the above situations or at home, but the speed can still
be greatly affected by the number of ads being loaded that I don't even see.
Even my cable internet provider still gives me only a measly 384kilobit upload
speed, and that now has to be shared between even more outgoing connections?

To top it all off, from an ad-provider's perspective, why should I be paying
for ad impressions that the end user doesn't even get to see? At least with
Adblock, my server bandwidth isn't used, and my impression statistics aren't
being impacted by users who aren't actually getting the chance to view the
content...

------
Semiapies
Greasemonkey-esque functionality is the main thing I've been missing in
Chrome, so this looks appealing.

~~~
catch23
well the cool thing about greasemonkey was that you could do a little more
than just inject javascript code... for example, you could make cross domain
xhr calls as well, and it did so by jumping out of the security sandbox to do
this. I'm not so sure if it will be possible in chrome...

~~~
Semiapies
Fair enough; I've never had call to do that in my own GM scripts, but I can
easily see the use.

------
icefox
I can't wait to see how many people pick the unique number
00123456789ABCDEF0123456789ABCDEF0123456

~~~
blasdel
It's never a good idea to put valid UUIDs in tutorials, there's just too many
copy-pasters out there.

~~~
aboodman
Having to create an ID manually is temporary.

When complete, the ID is going to be a hash of the extension's public key, and
extension content will be signed with the key. So there won't be conflicts
(unless you share your private key).

------
est
Does anyone know how to add a right click menu item so I can invoke a external
download tool for URLs?

------
dpeq
Anyone switched to the developer-channel version of Chrome yet?

------
mapleoin
can somebody write a plugin to port Chrome to other OSes?

Note: i'm being sarcastic

