2014-11-03 67 views
1

我想这会将所有请求延期:Firefox扩展重定向文件

http://website.com/foo.js

到:

http://localhost/myfoo.js

我不能用hosts文件,编辑从网站主机.com到localhost,因为我只想将重定向应用于foo.js.

我尝试使用这个扩展:

https://addons.mozilla.org/en-US/firefox/addon/redirector/

但它仅适用,如果你在地址栏中键入http://website.com/foo.js,我想它重定向任何人访问该链接到我的本地版本。

例如,如果http://website.com/bar.html使用http://website.com/foo.js那么我希望它使用http://localhost/myfoo.js来代替。

回答

0

你可以用request-redirect模块,而这个代码做到这一点:

let { Redirect } = require("request-redirect"); 
Redirect({ from: "http://website.com/foo.js", to: "http://localhost/myfoo.js" }); 

欲了解更多信息使用入门的建设附加see this documentation

+0

这个基本功能是否没有现有插件?我感到震惊。 – Jimmay 2014-11-24 22:52:34

相关问题