I'm creating a simple user script and I want to select an node that is 
inside of an iframe document. The node that I want to select is an <embed> 
that is in an iframe document hosted in other domain:

<iframe class="smart_sizing_iframe" id="iframe_canvas" 
name="iframe_canvas_fb_https" src="javascript:"""> 
<html> 
<body> 
<div> 
<div> 
<embed firstframecallback="UnityObject2.instances[0].firstFrameCallback();" 
type="application/vnd.unity" 
src="https://deadtrigger2-fb.ssl.hwcdn.net/0.7.0-rc1-r49324/DeadTrigger2.unity3d";></embed>
 
</div> 
</div> 
</body> 
</html> 
</iframe>

My JavaScript lines (I set @include for both domains):

// @include https://*.facebook.com/deadtrigger_ii/
// @include https://integrated-plugin-canvas-*-*.fbsbx.com/apps/*/?params=*
var iframe = document.getElementById('iframe_canvas'); 
var otherdocument = iframe.contentDocument || iframe.contentWindow.document; 
var unity = otherdocument.querySelector("embed[type='application/vnd.unity']"); 
unity.style.setProperty("margin", "0px", "important");

Is there some problem? What do I need to do to get that <embed>?

I'm very amateur in JavaScript, I need help. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to