Skip to content

Fiddler Rules

Julian Descottes edited this page Dec 12, 2013 · 1 revision

Use Fiddler to redirect static calls from piskel-website to your local statics.

  • Go to Rules > Edit ...
  • Add the function below before OnBeforeRequest
  • call it from OnBeforeRequest (after mapping it to a menu option for instance)
static

function redirectPiskelStatics(oSession: Session) {
  var piskelRoot = "C:\\Development\\git\\piskel\\";
  var PAQ = oSession.PathAndQuery;

  if (/\/p\/(.*(?:js|html|css))/i.test(PAQ)) {
    var filePath = PAQ.replace(/\/p\/(.*(?:js|html|css))/i, "$1");
    oSession["x-replywithfile"] =  piskelRoot + filePath.replace("/", "\\");
    oSession["ui-backcolor"] = "#FFCC00";
    oSession["ui-color"] = "black";
  }
}