// http://ie.microsoft.com/testdrive/HTML5/CompatInspector/help/snippet.txt
// Snippet 1: Place this inside the "OnBeforeResponse" handler in your FiddlerScript
InjectInspectorScript(oSession);
// Snippet 2: Place this near the end of your FiddlerScript (within the Handlers class)
public static RulesOption("Use Compat Inspector")
var m_UseCompatInspector: boolean = false;
static function InjectInspectorScript(oSession: Session)
{
if(!m_UseCompatInspector) return;
// Ensure we only inject into HTML
if (oSession.url.EndsWith(".js")) return;
if (oSession.url.EndsWith(".css")) return;
if (!oSession.oResponse.MIMEType.Contains("text/html")) return;
// Retrieve the response body
var sBody = oSession.GetResponseBodyAsString();
// One final check to ensure the content looks like HTML
if (!/^\uFEFF?\s*", doctype + 1);
if (doctype != -1 && doctype != sBody.Length - 1) pos = doctype + 1;
// Place after first X-UA-Compatible meta tag (if present)
if (meta != -1) meta = sBody.IndexOf(">", meta + 1);
if (meta != -1 && meta != sBody.Length - 1) pos = meta + 1;
// Place before any script tags that occur before the current position (if present)
if (script != -1 && script < pos) pos = script;
// Perform the injection at the detected location
oSession.utilSetResponseBody(
sBody.Insert(pos, "")
);
}