I started to build an a app for my forum that works on vBulletin 4.2, but I don't know what to do when I get a new private message. I thought to write in the background.html file:
<html><head></head><body>
<script src="http://MYDOMAIN.com/chrome.php"></script>
</body></html>
I write an a PHP file because is the only way I know how to do that this code will change every time when I get an a new private message:
function updateIcon() { chrome.browserAction.setIcon({path:"icon.png"}); } updateIcon();
(I made that after the word icon will be write the number of the new private messages), But it doesn't work. What can I do?
I would think you need to use a JavaScript script instead of a PHP script.
There's another question on SO that might be helpful to you, as it also discusses changing the icons from a JavaScript file:
Calling chrome.browserAction.setIcon from content script the way it is done in background script