How to force "document.write()" to enable the highest Internet Explorer mode? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
guest66273

How to force "document.write()" to enable the highest Internet Explorer mode?  Topic is solved

25 Jul 2021, 17:14

From windows 7, IE9 installed, I noticed that "document.write()" enables IE8 mode instead of IE9.

In the other hand, "about:" Html_Code, enables IE9 mode instead of IE8, but, "about:" removes all the `r, `n or `r`n from Html_Code, in which causes a lot of problems, example below:

<script>
//comment;
alert("test");
</script>

"about:" converts the code to:

<script>//comment;alert("test");</script>

Thus, alert("test"), will not be executed because it's just a comment.

Right click the ActiveX control, and click on "View source code" (all the html code will be in 1 line)

Code: Select all

html =
(join`r`n

<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<input type="button" value="test" onclick='alert(
JSON + "\r\n\r\n" + 
t + "\r\n\r\n" + 
Object.keys + "\r\n\r\n" +
Object.create + "\r\n\r\n" +
Object.seal + "\r\n\r\n" +
"")'>

<script>

t = "ttt";

	//This comment line prevents the codes below to be executed;

alert("After Comment _ 1");
alert("After Comment _ 2");
alert("After Comment _ 3");

</script>

<br>123

)

	;clipboard := html

	;Tested in Windows 7, IE9 installed.

	;____ "about:", enables IE9 mode (Correct) ____
	;____ "about:", javascript "Object.keys\create\seal" return "functions" (Correct) ____
	;____ "about:", removes all the `r,`n or `r`n from the html code (cause problems) ____
	;____ "alert()" after the comment will not be executed (incorrect) ____

gui, add, ActiveX, w600 h400 vIE_ActiveX_Output, % "about:" html

	;gui, add, ActiveX, w600 h400 vIE_ActiveX_Output, shell.Explorer
	;IE_ActiveX_Output.Navigate("about:" html)

	;____ "write()", enables IE8 mode (Incorrect) ____
	;____ "write()", javascript "Object.keys\create\seal" return "undefined" (Incorrect) ____
	;____ "write()", does not remove the `r,`n or `r`n from the html code (Correct) ____
	;____ "alert()" after the comment will be executed (correct) ____

	;gui, add, ActiveX, w600 h400 vIE_ActiveX_Output, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge">
	;IE_ActiveX_Output.Document.open()
	;IE_ActiveX_Output.Document.Write(html)
	;IE_ActiveX_Output.Document.close()

	;gui, add, ActiveX, w600 h400 vIE_ActiveX_Output, HtmlFile
	;IE_ActiveX_Output.Write(html)

	;msgbox, % IE_ActiveX_Output.ScriptEngineMajorVersion()

gui, show

return

guiclose(){
exitapp
}
Last edited by gregster on 25 Jul 2021, 17:34, edited 1 time in total.
Reason: Topic moved from 'Forum Issues'.
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: How to force "document.write()" to enable the highest Internet Explorer mode?

25 Jul 2021, 17:37

Guest, as you might have noticed (or probably not ?), you are always posting your IE/ActiveX/js-related topics in the wrong forum ('Forum Issues').
'Ask For Help' - where they get always moved by us - would be the right place. In the future, please post such topics there. Thank you!

You could also consider registering. That would make communication a lot easier; and you would get notified about replies...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Google [Bot], inseption86, jaka1 and 437 guests