I have following piece of code in my fiddlerscript:
RulesString("Redirect Foo", true)
RulesStringValue(0, "to the latest version", "latest")
RulesStringValue(1, "to a particular version... (e.g. 1.2.3)", "%CUSTOM%")
public static var foo_redirect: String = null;
It renders as a submenu and clicking Redirect Foo to a particular version...
opens a prompt box where you can type something.
Now, I want to validate that the user typed something following a regexp, and not a totally random string, and display a FiddlerObject.alert
if he put something non-conformant.
How can I do the validation just after the user inputs the value, but before there's any redirection happening? (I don't want to defer it to OnBeforeRequest
since it may display dozens of alerts there, one per each session - Foo is a folder with many JS files).
Fiddler does not offer a mechanism to validate the values of the %CUSTOM%
token at the point of entry. If you want to do that, don't use RulesString
, instead use FiddlerScript or an extension to add a menu of your own devising.