I want to change content of iframe without src. So i try
var doc = findIframe().get(0).contentWindow.document;
doc.open();
doc.write(GM_getResourceText('iframe.html'));
doc.close();
Where content of iframe.html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iframe</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">some style</style>
<script> some script</script>
</head>
<body>
</body>
</html>
But all elemets instead of iframe head appends to iframe body. I execute script from main window. How it can be solved?