I am creating a Google Chrome extension that places some IMG tag on sites. This img tag on: hover should show a custom cursor. The extension uses jQuery as the built-in kernel script. I tried the following methods:
1.
var cursor = 'url('+chrome.extension.getURL('icons/cursor.cur')+')';
$('#myImgId').css({
'position': 'absolute',
'top':'5px',
'left':'5px',
'cursor':cursor
});
This is the best job. On small sites, a cursor is displayed. On slower download sites this is not the case. But on small sites, this sometimes happens.
2.
var cursor = 'url('+chrome.extension.getURL('icons/cursor.cur')+')';
$('<style>#myImgId{cursor:'+cursor+'}</style>').appendTo('head');
It did nothing.
3.
In manifest.json, I introduced css.
"content_scripts": [
{
"matches": ["http://*/*"],
"css": ["css/style.css"],
"js": ["j/c.js", "j/s.js"]
}
There was only a pointer in the css file: url (icons / cursor.cur), since I have no idea how to get the real url in the css file. This does not work at all. I think it should work like this, I did not find a link to this on code.google.