I have a script which adds a div to a page containing a full-screen Flash object, like this:
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);
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.
// code which apparently does nothing:
myDiv.style.zIndex = "999";
var swf_div = document.getElementById("swf_div");
if (swf_div) {
swf_div.style.zIndex = "-999";
}
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?
ETA host page (glitch.com/game) source excerpt:
<body>
...
<div id="client_div" style="width: 1680px; left: 0pt;">
<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;">
<param name="allowscriptaccess" value="always">
<param name="allownetworking" value="all">
<param name="wmode" value="direct">
<param name="flashvars" value="--- auth tokens, omitted ---">
</object>
</div>
...
</body>