'Changing value of server .js variable

I'm playing with fiddler scripting and I want to change value of server's js where there are a few calls of: "this.isChatAvailable = 0". I want to change it to "this.isChatAvailable = 1".

I tried to use this approach:

 if (oSession.HostnameIs("pageurl.com") {
    oSession.utilReplaceInResponse("this.isChatAvailable = 0","this.isChatAvailable = 1"); 
 }

but in both OnBeforeResponse and OnBeforeRequest methods when page is re-loaded it still don't show me the window which is blocked by mentioned variable.

Any idea what did I messed up here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source