Ok- so is there a relatively easy way to reference a local file versus
one on the Internet? I'm just trying to save the bandwidth.

Can I edit this so it would work?

pdflinks[i].style.background = 'url(something-here/
edonhiglkbcngojedpmbgenfgohdekoj/image.gif)';


On Oct 18, 10:40 am, Jói Sigurðsson <[email protected]> wrote:
> To build URLs relative to the base of the extension, use
> chrome.extension.getURL(relativeUri).  See API documentation 
> athttp://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.
>
> 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