Anyone know how to resolve a URL for an extension packages file in an extension's CSS file? In the JavaScript I can just use something like chrome.extension.getURL("images/overlay/close.png") and it'll return the "chrome-extension://" URL for the file.
But I'm trying to figure out how to do the same thing in a CSS file, like one loaded via the manifest.json file like:
On Tue, Jan 19, 2010 at 5:19 PM, GeorgesMouth <geo...@gadgetopolis.com> wrote: > Anyone know how to resolve a URL for an extension packages file in an > extension's CSS file? In the JavaScript I can just use something like > chrome.extension.getURL("images/overlay/close.png") and it'll return > the "chrome-extension://" URL for the file.
> But I'm trying to figure out how to do the same thing in a CSS file, > like one loaded via the manifest.json file like:
> -- > You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. > To post to this group, send email to chromium-extensions@googlegroups.com. > To unsubscribe from this group, send email to chromium-extensions+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
Hi George, you could convert your resources to base64 encoded content simply using e.g. tools like: http://webcodertools.com/imagetobase64converter/Create so your css will be: div.Overlay div.close{ background-image: url(data:image/png;base64,iVBORw ........
};
regards, Peter On Jan 20, 2:19 am, GeorgesMouth <geo...@gadgetopolis.com> wrote:
> Anyone know how to resolve a URL for an extension packages file in an > extension's CSS file? In the JavaScript I can just use something like > chrome.extension.getURL("images/overlay/close.png") and it'll return > the "chrome-extension://" URL for the file.
> But I'm trying to figure out how to do the same thing in a CSS file, > like one loaded via the manifest.json file like:
> Hi George, > you could convert your resources to base64 encoded content simply > using e.g. tools like:http://webcodertools.com/imagetobase64converter/Create > so your css will be: > div.Overlay div.close{ > background-image: url(data:image/png;base64,iVBORw ........};
> regards, > Peter > On Jan 20, 2:19 am, GeorgesMouth <geo...@gadgetopolis.com> wrote:
> > Anyone know how to resolve a URL for an extension packages file in an > > extension's CSS file? In the JavaScript I can just use something like > > chrome.extension.getURL("images/overlay/close.png") and it'll return > > the "chrome-extension://" URL for the file.
> > But I'm trying to figure out how to do the same thing in a CSS file, > > like one loaded via the manifest.json file like:
In the Javascript I create the chrome-extension:// URL for the image:
... var closeButtonURL = chrome.extension.getURL('images/overlay/ close.png'); ...
The div's that I'm trying to apply this to begin as JavaScript strings and are injected from the Javascript, so I add the background image in there using the 'style' attribute: