Skip to content

Instantly share code, notes, and snippets.

@ilmax
Created July 1, 2016 10:39
Show Gist options
  • Save ilmax/0b6dc1c062797a3d629915475ecbb4c5 to your computer and use it in GitHub Desktop.
Save ilmax/0b6dc1c062797a3d629915475ecbb4c5 to your computer and use it in GitHub Desktop.
Fiddler exclude css & javascript rules by @hasegawayosuke
// Open Fiddler and Choose "Rules" menu, click "Customize Rules..." and add this code to CustomRule.js
class Handlers
{
// ....
public static RulesOption("Hide CSS")
BindPref("fiddlerscript.rules.HideCSS")
var m_HideCSS: boolean = false;
// ....
static function OnBeforeResponse(oSession: Session) {
// ....
if (m_HideCSS && oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/css") )
{
oSession["ui-hide"] = "true";
}
// ....
}
public static RulesOption("Hide JavaScript")
BindPref("fiddlerscript.rules.HideJS")
var m_HideJS: boolean = false;
// ....
static function OnBeforeResponse(oSession: Session) {
// ....
if (m_HideJS && (oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/javascript") || oSession.oResponse.headers.ExistsAndContains("Content-Type", "application/x-javascript") || oSession.oResponse.headers.ExistsAndContains("Content-Type", "application/javascript")))
{
oSession["ui-hide"] = "true";
}
// ....
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment