browser extension to replace JavaScript file on a live site for testing

前端 未结 11 1944
心在旅途
心在旅途 2021-02-07 04:57

I\'m looking for a browser extension (Firefox, Chrome) allowing to replace a Javascript file on a live Web site to do some testing/hacking.

Basically, it should take a U

相关标签:
11条回答
  • 2021-02-07 05:08

    ColBeseder correctly brings up Fiddler (http://www.fiddler2.com/fiddler2/version.asp) as a solution to your issue.

    Fiddler is perfectly capable of handling and decrypting HTTPS traffic as well - see the documentation on the page for how to configure it.

    To directly answer the OP question, you can use the autoresponder feature in Fiddler to hack your production JS for testing.

    Enable the autoresponder tab in Fiddler, making sure to leave pass through for unmatched requests checked, entering the URL of the JS files you want to substitute as the pattern. Select the response file from your local filesystem, and go to town!

    See http://yuiblog.com/blog/2008/06/27/fiddler/ (bottom of article is most relevant) for an example.

    0 讨论(0)
  • 2021-02-07 05:09

    You can intercept and block requests in browsers. For example in Chrome you can use the beforeload event check if it's a JS (event.target is script tag or event.url ends in .js) call event.preventDefault() and then load your own script instead.

    I'm pretty sure there's a similar way to do this in FF.

    0 讨论(0)
  • 2021-02-07 05:10

    You should probably consider robohydra, since it is specifically developed for your case. They do not support https yet, but they are open to including it in the future.

    0 讨论(0)
  • 2021-02-07 05:13

    How about Greasemonkey? That should be the thing you're searching for!

    0 讨论(0)
  • 2021-02-07 05:17

    There is https everywhere which lets you define rules for url rewrites. This should work on all request, including script requests.

    Tamper data might do the job, but I don't know how automated/permanent you can set it up.

    And there is also an extension called redirector. I didn't test that one. Potentially it only works on the address bar.

    Update:

    That is unfortunate. In that case probably a proxy is you only way. What about a firefox extension that is a proxy, like Foxyproxy

    0 讨论(0)
  • 2021-02-07 05:19

    I think this is a task for a personal proxy. You can sniff traffic on the proxy and apply rules to modify requests/content

    0 讨论(0)
提交回复
热议问题