OWASP O2 Platform Blog

Weird behaviour with IE’s about:blank

Usually I use about:blank when wanting to open a blank page in a browser. Today I noticed an interresting behaviour in the embeded IE object that I use in O2 (via WatiN).

What happens is that if we don’t use ‘blank‘ and use other text (for example about:AAAA), that other text will be displayed in the page (in this case AAAA).

What is interresting is that it supports HTML tags, which means that opening the url “about:<h1>hello</h1>” will show the word hello under the h1 style.

Here is a quick O2 script that replicates this behaviour:

var topPanel = panel.clear().add_Panel();
var ie = topPanel.add_IE().silent(false);



ie.open("about:<script>document.write('dynamic script')</script>");


//these ones don't work from here
//ie.open(@"about:<iframe src='http://google.com' width=400 height=100> </iframe>");   
//ie.open(@"about:<iframe src='\C:\O2\Demos\testFile.txt' width=400 height=100> </iframe>");   
return "done";

//using O2.XRules.Database.Utils.O2

Note that this doesn’t seem to work on normal IE, Chrome or Firefox (I only saw it in action in the embeded IE)

November 30, 2011 Posted by | IE Automation | 3 Comments