2
 background-image:url(chrome-extension://__MSG_@@extension_id__/image.png);

For an extension that works for Firefox and Chrome, I just need to refer to a single image file in a CSS file.

chrome-extension:// works only for Chrome moz-extension:// works only for Firefox

So I am stuck to create 2 separate CSS files just for single line of code.

Is there any short-cut for both of protocols?

Relative paths does not work for Chrome. Rather than searching in the root directory of the extension, Chrome searches the image file in web site root directory.

Nico Neill
  • 113
  • 2
  • 8
  • 3
    There are multiple solutions. One reasonably easy one is [browser specific CSS](https://www.google.com/search?as_q=browser+specific+CSS). There are probably more Stack Overflow questions and answers, but [Targeting only Firefox with CSS](https://stackoverflow.com/q/952861) should provide one way of doing it. – Makyen Aug 31 '17 at 02:13
  • 1
    @Makyen You really should make that into an answer. – Xan Aug 31 '17 at 13:02

0 Answers0