Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Reload not working #6

Open
rajyraman opened this issue Sep 12, 2016 · 5 comments
Open

Auto Reload not working #6

rajyraman opened this issue Sep 12, 2016 · 5 comments
Assignees
Labels

Comments

@rajyraman
Copy link

rajyraman commented Sep 12, 2016

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)

@gotdibbs
Copy link
Owner

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

image

@rajyraman
Copy link
Author

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?

@gotdibbs
Copy link
Owner

@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.

@gotdibbs gotdibbs self-assigned this Sep 14, 2016
@rajyraman
Copy link
Author

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.

@gotdibbs
Copy link
Owner

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants