Good to see you are trying to build an extension, its a lot of fun!

First of all you would need to use a browser
action<http://code.google.com/chrome/extensions/browserAction.html>with
"no popup" and within the background page, you can add an onClicked
event to inform you that it has been clicked. TheTab Extension
API<http://code.google.com/chrome/extensions/>has a function called
getSelected<http://code.google.com/chrome/extensions/tabs.html#method-getSelected>
that
you can use that to get the currently selected tab. Once you get that tab,
there is a bunch of
properties<http://code.google.com/chrome/extensions/tabs.html#type-Tab>that
you can use. One property is "url". Once you get that URL, you can
open
a new window (using the Tab API) with the customized URL you are creating.

Remember, everything is event driven, you can take a look at a couple of
samples stated here to get your started:
http://code.google.com/chrome/extensions/samples.html

<http://code.google.com/chrome/extensions/samples.html>
-Mohamed Mansour


On Fri, Jan 15, 2010 at 9:12 PM, Johnathan <johnathan.barr...@googlemail.com
> wrote:

> Hi, I'm building my first Google Chrome extension. I just want to know
> if I can and how when I click the button for my extension to run it
> gets the URL in the address bar and appends it to another URL that I
> specify. I want to make an extension for my URL shortener.
> I don't want someone to do it for me, just point me in the right
> direction. Also auto copy to clipboard would be great, would this be
> down to Chrome or just some plain js?
> Thank you :) And sorry if I'm not meant to post this sort of stuff
> here.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.

Reply via email to