gotdibbs/Imposter.Fiddler

Auto Reload not working

rajyraman opened this issue · 5 comments

I get this error when I try to enable Auto Reload the first time. I no longer get the error after re-opening fiddler, but the browser doesn't seem to be refreshing when I change the files on the disk. I am changing a JS webresource. Is this feature available only for html files at the moment?

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Imposter.Fiddler.Imposter.AutoReload_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Do you have Imposter Enabled when you're toggling on Auto Reload? See below.

image

Yes. I also have X-Imposter response header and confirmed that it is using the local version of the webresource. In the blog post you say

If it detects a change, any HTML web resource that was already swapped out by Imposter will automatically refresh itself to account for the newest updates.

So, does this mean JS webresources won't be auto refreshed?

@rajyraman what happens is that Imposter injects a script into any HTML page it serves up based on your configuration which polls Fiddler to check and see if any files have changed on your computer. If they have, the injected script refreshes the page. This means that if you have script attached to a form in Dynamics CRM, it will not refresh. The only time a JavaScript web resource would refresh is when it is included on an HTML web resource.

I'll look into the exception you're getting a bit more, but likely won't have time until later this week. Feel free to download the source code and try to debug before then if you'd like. Should be as simple as cloning, then F5-debugging.

No longer an issue. Seems to be the case of PEBKAC. Once I configured the mapping correctly crm webresource to local folder base url, it is working. Added one small change to AutoTamperResponseBefore, just to check for MIMEType.

tamper

Working great. Good job with the tool.

@rajyraman Glad it's working now! I'm going to keep this open until I hunt down that NullReferenceException but please let me know if you have any other issues or suggestions!