Google谷歌搜索页面dq.tieba.com贴吧链接替换 dq.tieba.com to tieba.baidu.com for Google results

最近访问dq.tieba.com老是出现 “您好,该页面正在维护中。” 于是就写了这个。为什么要在Google搜索页面替换呢?这是因为当你按dq.tieba.com时服务器就给你的浏览器发个HTTP 302重定向到维护页面,脚本都来不及执行

These are versions of this script where the code was updated. Show all versions.

  • v0.22 2019-10-05 refactoring
  • v0.21 2019-10-05 memoised regex.test
  • v0.20 2019-10-04 avoid the 'this' keyword for good
  • v0.19 2019-10-04 improved regex
  • v0.18 2019-10-04 try {} catch {} -> try {} catch(err) {} ; minor formatting changes
  • v0.17 2019-10-04 improved regex
  • v0.16 2019-10-04 URL instances are cached; opted for arrow functions and const for readability
  • v0.15 2019-10-03 taken care of both 'q=' and 'url=' query strings; added weblight view handling
  • v0.14 2019-10-03 improved naming convention
  • v0.13 2019-10-03 map -> forEach
  • v0.12 2019-10-03 minor changes to code formatting
  • v0.11 2019-10-03 added more url matches; using standard url glob instead of regex for url patterns; refactored
  • v0.10 2019-10-03 support for google redirection links when user-agent is of a mobile browser
  • v0.9 2019-10-03 added www.tieba.com
  • v0.8 2019-10-03 beautified code
  • v0.7 2019-10-03 wrapped script in anonymous function
  • v0.6 2019-10-03 no more arrow functions
  • v0.5 2019-10-03 avoided arrow functions
  • v0.4 2019-10-02 Updated patterns
  • v0.3 2019-10-02 Updated description and name
  • v0.2 2019-10-02 updated description
  • v0.1 2019-10-02