firefox - Possible to flash a Browser window using Javascript? -


Flash on their taskbar / dock Alert to switch to the program,

Is it possible to flash the Browser window using Javascript? (Firefox - only scripts are welcome)

This is useful for web-based chat / forums / community-based software, where many real-time activity.

@Hexagon Principle: Why you should always rewrite whole head element to change in head Value of an element? Your solution is extremely inefficient at many levels.

  & lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "icon" href = "on.png" type = "image / png" id = "changeMe" /> & Lt; Script type = "text / javascript" src = "flash.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

flash.js:

  function flasher (speed) {var elem = document.getElementById ('changeMe'); This.timer = setTimeout (function () {elem.href = elem.href == 'on.png'? 'Off.png': 'on.png';}, speed); This.stop = function () {clearTimeout (this.timer); }} / * Sample usage * * var flasher = new flasher (1000); * Flasher.stop (); * /  

This was not really a class but it helped keep the global namespace clean. It is untested, but if only the href changes, do not work for some reason, then clone the link node, change the href and replace the old link with the clone.


Comments