Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forcing a page to render in standards mode using a BHO

7 views
Skip to first unread message

Jonny

unread,
Nov 19, 2011, 2:34:06 PM11/19/11
to
I am creating a BHO which injects some code into certain web pages. I
created it to support IE8 and up, however, some of the pages that I
need to inject code into don't have a DOCTYPE tag and thus the pages
are being rendered with the IE6 engine (i.e., in Quirks mode). I need
to figure out some way to force these pages to be rendered with the
latest engine.

I have looked through the documentation for the InternetExplorer and
IWebBrowser2 objects and I cannot find any methods or properties which
allow for the document mode to be set.

The method that I have been trying to implement is to inject a "X-UA-
Compatible: IE=edge" header into the response for certain. To this
end, I have been experimenting with Igor Tandetnik's PassthruAPP, as I
have learned from several different sources that it is possible to
modify the response headers by reimplementing the HTTP and HTTPS
protocols. However, I have reached a dead end with this approach
because I can't for the life of me figure out how to actually modify
the response headers. I have a working version of the PassthruAPP
loaded up in my BHO, and I know how to intercept the headers (in the
OnResponse method), but it doesn't seem like I am able to modify the
headers from there as well.

It seems like another possible approach is to create a new key/value
inside of the FeatureControl key in the registry, but I'm not sure how
or even if that would work.

So at the moment I'm pretty stumped. Any help would be extremely
appreciated.

Thanks!
0 new messages