Iframe chargé par fichier externe
Bonjour à tous! Voila j'ai un petit souci je craie un script utilisé par greasemonkey qui est censé modifier le contenu d'une iframe. Le problème c'est que quand j'essaye d'y accéder à partir du script j'ai un erreur sur firebug.
Comme si on ne pouvait pas accéder a celle-ci.
erreur:
Citation:
uncaught exception: [Exception... "Security Manager vetoed action" nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)" location: "JS frame :: file:///C:/Documents%20and%20Settings/cha56599/Application%20Data/Mozilla/Firefox/Profiles/zxqq8bop.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js :: touche_entrer :: line 123" data: no]
iframe:
Code:
1 2 3 4 5 6 7 8 9 10 11
| <iframe scrolling="no" height="600px" frameborder="0" src="javascript:""" name="iframe_canvas" id="iframe_canvas" class="canvas_iframe_util noresize" style="height: 800px; overflow-y: hidden;">
<html>
<body>
<div id="x" > test</div>
</body>
</html>
</iframe> |
code javascript:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
var arrayImg = document.getElementById("iframe_canvas");
alert(arrayImg.id);
var fils = arrayImg.childNodes;
var nbFils = fils.length;
alert(nbFils);
if(arrayImg.contentDocument){
j= arrayImg.contentDocument;
}else if(arrayImg.contentWindow){
j= arrayImg.contentWindow.document;
}else{
j= arrayImg.document;
} |