Tampermonkey脚本没有重定向到预期的URL?

时间:2016-02-24 22:41:56

标签: javascript google-chrome href tampermonkey

每当使用某些搜索字词时,我都会尝试将访问过的网址替换为其他网址。

但是,浏览bing.com这个词git pull --rebase origin <main-branch-name>会产生网址"foobar"而不只是bing.com/www.google.com.au

我尝试过同时使用google.com.aulocation.href

location.replace()

1 个答案:

答案 0 :(得分:1)

除非以协议作为前缀,否则将URL视为相对URL。特别要解决你的问题,我建议

var NewUrl = 'https://www.google.com.au'