Thanks Aaron,

That's what I thought.
The solution is defeating the purpose a bit.
I guess I will have to write a script to modify these rules
dynamically or just refer a url from my webserver and take the hit.

Regards,

Yohann Richard

PS: I know you guys must hear this too often right now, but here it
goes : "you can do it in Firefox".



On Jun 5, 11:13 am, Aaron Boodman <[email protected]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to