Hi Benjamin. You should be able to use the <a href="http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx" title="documentMode prpoerty" rel="nofollow">documentMode property</a> of the document to determine the mode. Checking for document.documentMode will return a numeric value telling you which docmode the page is in. I tested it by going to a site that rendered in IE9 standards mode, switching the Document Mode via F12 Developer Tools, and checking the documentMode using the dev tool Console. It worked perfectly.

Hope that helps.