Last active
December 19, 2023 16:42
-
-
Save ericlaw1979/decab196fe127cd9e548b7f675cf22c9 to your computer and use it in GitHub Desktop.
Reattach Fiddler as system proxy if unexpectedly detached; see https://feedback.telerik.com/fiddler/1410460-the-system-proxy-was-changed-click-to-reenable-capturing for discussion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Click Rules > Customize Rules. Scroll to OnBoot() and inside the function add: | |
static function OnBoot() { | |
FiddlerApplication.oProxy.add_DetachedUnexpectedly(DoReattach); | |
//... | |
// Just before the OnBoot function, add the following new functions: | |
static function DoReattach(o: Object, ea: EventArgs) { | |
FiddlerObject.UI.sbpInfo.Text = "Scheduling automatic reattach at " + new Date(); | |
// Reattach after 1 second; waiting 1 second increases the odds that whatever | |
// process was messing with the system settings is done doing that. | |
ScheduledTasks.ScheduleWork("reattach", 1000, innerReattach); | |
} | |
static function innerReattach() | |
{ | |
FiddlerApplication.UI.actAttachProxy(); | |
} | |
static function OnRetire() | |
{ // Detach this event handler to avoid memory leaks and duplicate processing. | |
FiddlerApplication.oProxy.remove_DetachedUnexpectedly(DoReattach); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment