Hm... never thought about this problem :). There's not a good way to
do this in CSS, but you can use JavaScript to do it:
var url = chrome.extension.getURL("image.png");
document.body.style.background = "url('" + url + "'");
- a
On Thu, Jun 4, 2009 at 5:10 PM, yohann.richard<[email protected]> wrote:
>
> Hi guys,
>
> Can you please tell me how to use the background-image CSS property to
> reference an image coming from the extension directory ?
>
> I am injecting my CSS using the manifest definition :
> {
> "name": "My First Extension",
> "version": "1.0",
> "description": "The first extension that I made.",
> "content_scripts": [
> {
> "matches": ["http://*/*", "https://*/*"],
> "css": ["mycss.css"]
> }
> ]
> }
>
> and here's my mycss.css :
> body
> {
> color:red;
> font-weight:bold;
> background:yellow url(image.png) repeat;
> }
>
> the image is also located in the extension directory.
>
> Thanks and great job !
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Chromium Discussion mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-discuss
-~----------~----~----~----~------~----~------~--~---