2009/10/18 Jói Sigurðsson <[email protected]>:
>
> To build URLs relative to the base of the extension, use
> chrome.extension.getURL(relativeUri).  See API documentation at
> http://chromeextensionsdocs.appspot.com/
>
> Referring to resources within the extension should work fine from
> extension pages (e.g. background page or a browser action drop-down)
> but calling chrome.extension.getURL() will not work from a user script
> since user scripts run in the context of whichever page(s) you target
> them to, and those pages don't have access to the extension APIs.

Thanks for replying Joi.  Just one small clarification.  User scripts
have access to *almost* none of the extension APIs.  One that they do
have access to is chrome.extension.getURL().  Please use this within
content scripts rather than trying to build up the URL manually.  It
will make it easier for you while you're testing.

The others that are available are chrome.extension.connect() and
chrome.extension.onConnect:
http://code.google.com/chrome/extensions/extension.html

It would be nice if we could be a bit more obvious about which are
accessible and which aren't.

Erik




>
> Cheers,
> Jói
>
>
> On Sun, Oct 18, 2009 at 9:40 AM, ehamiter <[email protected]> wrote:
>>
>> Sorry to ask, but could you clarify a little? I tried
>>
>> pdflinks[i].style.background = 'url(location.hostname://
>> edonhiglkbcngojedpmbgenfgohdekoj/image.gif)';
>>
>> but that didn't work.
>>
>>
>> On Oct 17, 9:21 pm, Pedro Junior <[email protected]> wrote:
>>> location.hostname
>>>
>>> On Oct 17, 10:59 pm, ehamiter <[email protected]> wrote:
>>>
>>> > Title says it all, really. Using find and replace links and want to
>>> > include a local image instead of calling on the http address to save
>>> > bandwidth. I have the image in the directory, and manually typing in
>>>
>>> > chrome-extension://edonhiglkbcngojedpmbgenfgohdekoj/image.gif
>>>
>>> > works. However, when I try to use it in a script as such
>>>
>>> > links[i].style.background = 'url(chrome-extension://
>>> > edonhiglkbcngojedpmbgenfgohdekoj/image.gif) no-repeat';
>>>
>>> > then it doesn't get called. Can I get around this?
>>>
>>> > Thanks.
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to