Browser Emulation
Not logged in

Browser Emulation

Preview HTML uses the WebBrowser control to render the HTML. This uses the same engine as the Internet Explorer (IE) browser. Since version 8, that engine is capable of rendering a HTML page (more or less) like the preceding version(s) did.

You can see one of the effects of this 'change' by copying the following code into a new document in Notepad++, setting the highlighting language to HTML, and opening the preview pane:

<html>
	<body>
		<script>
			document.write(navigator.userAgent);
		</script>
	</body>
</html>

Since version 1.1 of the plugin, you can choose which version of IE should be emulated. This 'browser emulation' setting can be configured for each application. In the case of Preview HTML, this means that this setting can only be changed for Notepad++ as a whole. If you have any other Notepad++ plugin which uses the WebBrowser component, those will also switch to the indicated version. It also isn’t possible to use different browser modes for different documents.

Since this setting is only read once, on startup of the application, you’ll always have to restart Notepad++ before the new setting is observed.

For more information, see MSDN.

Perceived version

Until version 1.4 of the plugin, the plugin determined which version of IE was available, and showed the appropriate menu items accordingly. Unfortunately, IE10 was not identified properly, so a new setting was introduced in version 1.4, which allows overriding the perceived IE version.

In the settings file, you can specify the actual version to emulate in "Emulation/IE Version":

[Emulation]
Installed IE version=10.0