在Chrome中覆盖Javascript文件 [英] Override Javascript file in chrome

查看:396
本文介绍了在Chrome中覆盖Javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用我自己的chrome版类似javascript文件的版本覆盖javascript文件.

I would like to override a javascript file with my own version of the similar javascript file in chrome.

让我解释一下:

1)假设某个网站" http://example.com "调用了"

1) Lets say a site 'http://example.com' calls 'http://example.com/script/somescript.js'.

2)我想做的是覆盖文件' http://example.com/script /somescript.js ",我的版本位于" http://localhost/script/somescript.js '.

2) What I would like to do is override the file 'http://example.com/script/somescript.js' with my own version located at 'http://localhost/script/somescript.js'.

3)我需要有效地修改原始Javascript文件中的函数.

3) I need to effectively modify a function in the original Javascript file.

谢谢:-)

推荐答案

Chrome中有用于这些目的的插件和工具:

There are plugins and tools in Chrome for these purposes:

  1. Chrome浏览器的 DevTools ,选项卡本地替代 (Chrome 65支持)
  2. 请求
  3. 资源替代
  4. 您可能还想使用 Tamper ,它是基于mitmproxy的devtools扩展,可让您进行编辑本地远程文件,并将其直接提供给Chrome. (但是安装和使用它更加麻烦)
  1. Chrome's DevTools, tab Local Overrides (supported from Chrome 65)
  2. Requestly
  3. Resource Override
  4. You might also want to use Tamper, which is a mitmproxy based devtools extension that lets you edit remote files locally and serve them directly to Chrome. (but it's more headache to install and use it)

选择一种更易于使用的方式.

Choose the one which is easier to use for you.

这篇关于在Chrome中覆盖Javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆