Bug 927592 - add modal dialog handling when document is ready, and only in B2G, r=jgriffin, a=test-only