无须确认,直接跳转

让链接跳转提示自动跳转

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          无须确认,直接跳转
// @namespace     Don't confirm, just redirect.
// @match         *://none/
// @grant         none
// @version       0.0.3
// @author        -
// @description   让链接跳转提示自动跳转
// ==/UserScript==
const rules = [
  { // Weibo
    reg: /^https?:\/\/t.cn\/\w+/i,
    isit: () => { return document.body.querySelectorAll('p').length === 2 && document.body.querySelectorAll('p.link').length === 1 },
    link: () => { return document.body.querySelector('p.link').innerText }
  },
  { // Other
    reg: /https?%3A(?:%2F%2F|\/\/)/i,
    isit: true,
    link: ()=>{ return decodeURIComponent(
      window.location.search
        .replace(/^.*?(https?%3A(?:%2F%2F|\/\/))/, '$1')
        .replace(/&.*$/, '')
    ) }
  }
]
for(const rule of rules){
  if(rule.reg.test(window.location.href)){
    if(rule.isit()){
      window.location.href = rule.link()
    }
    break;
  }
}