This page is obsolete. Please see the new version at: http://code.google.com/chrome/extensions/getstarted.html
Getting Started
This tutorial will walk you through creating a simple extension that adds a button to a toolbar along the bottom of the browser window:
First of all, you will need to be using either the developer channel of Chromium or else a recent trunk build. Once you're using one of those, follow these instructions to create and add a basic extension.
- Create a folder somewhere on your computer to contain your work. For this discussion, we'll assume the folder is located at c:\myextension, but it can be anywhere.
- Inside this folder, create a text file called manifest.json and put this in it:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"toolstrips": [
"my_toolstrip.html"
]
}
- Add a text file to the folder called my_toolstrip.html, and put the following code in it:
<div class="toolstrip-button">
<span>Hello, World!</span>
</div>
- Find your chrome shortcut (for example, right-click the Chrome icon on your desktop and choose Properties) and add the --load-extension flag to it:
chrome.exe --load-extension="c:\myextension"
- Restart Chrome. You should see your button in a new toolbar along the bottom of the browser window.
- Perhaps you would like it better if the button did something? Ok, create a new text file in the same place called hello_world.html, and put this code in it.
- Now change the code in my_toolstrip.html so that it looks like this:
<div class="toolstrip-button" onclick="window.open('hello_world.html')">
<span>Hello, World!</span>
</div>
- Restart Chrome and click the button.
- Do a little dance, you earned it!
Notes
- --enable-extensions is only needed while the extensions system is in development and will be removed.
- We will eventually have better UI for arranging these.
Ok, Now What?
|
|