css - Refer static images or fonts in stylesheet when developing extensions for Chrome -


i creating google chrome extension. , want use background-image attribute of elements define through css. not sure how url() should given. tried relative url, tries fetch image relative site's domain! not relative extension's source directory.

the stylesheet included extension via manifest file follows:

  ...   "content_scripts": [     {       "matches": ["http://www.myblahblahsite.com/"],       "js": ["core.js"],       "css":["styles.css"]     }   ],   ... 

also, same custom fonts using @font-face

for example:

@font-face {     font-family: 'abccustom';     src:  url("fonts/abccustom.ttf") format('ttf'); } 

this won't consider font's path relative extension!

any ideas or suggestions? thanks.

you need make absolute url extension, best way this:

@font-face{   font-family: 'abccustom';   src: url('chrome-extension://__msg_@@extension_id__/fonts/abccustom.ttf') format('ttf'); } 

this part of i18n api.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -