typeof(window.external.addFavorite)

Please enable debugger in order to test this page.
This page has no DocType.

If there is a DocType in the beginning of the source, this bug is not reproduced.

test2(with DocType)