Note that there are some explanatory texts on larger screens.

plurals
  1. POPlace div over Flash object with userscript
    primarykey
    data
    text
    <p>I have a script which adds a div to a page containing a full-screen Flash object, like this:</p> <pre><code>var myDiv= document.createElement("div"); myDiv.style.background = "red"; myDiv.style.width = "30px"; myDiv.style.height = "30px"; myDiv.style.position = "absolute"; myDiv.style.top = "0"; myDiv.style.left = "0"; document.body.appendChild(myDiv); </code></pre> <p>In Firefox (running on Greasemonkey), myDiv appears on top of the Flash object. In Chrome (running on Tampermonkey), it is added underneath. I can't seem to change this by setting z-index - it is ignored.</p> <pre><code>// code which apparently does nothing: myDiv.style.zIndex = "999"; var swf_div = document.getElementById("swf_div"); if (swf_div) { swf_div.style.zIndex = "-999"; } </code></pre> <p>Is there any way I can get myDiv appearing on top of the Flash object in Chrome, considering that I don't own the host page and cannot set the wmode param of the Flash object? Why does it behave differently in FF vs Chrome?</p> <p>ETA host page (glitch.com/game) source excerpt:</p> <pre><code>&lt;body&gt; ... &lt;div id="client_div" style="width: 1680px; left: 0pt;"&gt; &lt;object id="swf_div" width="100%" height="100%" type="application/x-shockwave-flash" data="http://c1.glitch.bz/swf/Boot_78793.swf" style="visibility: visible;"&gt; &lt;param name="allowscriptaccess" value="always"&gt; &lt;param name="allownetworking" value="all"&gt; &lt;param name="wmode" value="direct"&gt; &lt;param name="flashvars" value="--- auth tokens, omitted ---"&gt; &lt;/object&gt; &lt;/div&gt; ... &lt;/body&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload