The problem is that the script content area is on the webpage your plugin is supposed to use.
So css background: url (images / ui-bg_inset-hard_100_fcfdfd_1x100.png) becomes url (' http: //webpageforplugin/images/ui-bg_inset-hard_100_fcfdfd_1x100.png ') so that it works, as I understand it, to me need it to point to: URL ('chrome extension: //extensionId/images/ui-bg_inset-hard_100_fcfdfd_1x100.png')
So I tried haxorz document.styleSheets
var ss = document.styleSheets;
for (var i=0; i<ss.length; i++) {
var found=-1, x,i;
var rules = ss[i].cssRules || ss[i].rules;
for (var j=0; j<rules.length; j++) {
if ('.ui-helper-hidden'==rules[j].selectorText){
found=i;
break;
}
}
if (found>-1){
for (var j=0; j<rules.length; j++) {
if (x=rules[j].style.background){
if ((i=x.indexOf('url'))!=-1)
rules[j].style.background = x.replace('http://page/images/','chrome-extension://extensionId/images/');
}
}
break;
}
};
I feel that I am missing the obvious. This should be an easier way.
Even if I manage to change this, how do I get the extension identifier to create the string.
Btw , . ( )
?
KamiMark