翻译垃圾再利用

跳转到源地址

目前為 2019-08-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name         翻译垃圾再利用
// @namespace    inqb.ga
// @version      0.2
// @description  跳转到源地址
// @author       no1xsyzy
// @match        *://xbuba.com/questions/*
// @match        *://www.itranslater.com/qa/details/*
// @match        *://itranslater.com/qa/details/*
// @match        *://codeday.me/bug/*
// @match        *://www.codenong.com/*
// @match        *://codenong.com/*
// @match        *://ask.helplib.com/others/*
// @match        *://hant.ask.helplib.com/others/*
// @match        *://qa.1r1g.com/sf/ask/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict'

    try{
        switch(window.location.hostname){
            case "xbuba.com":
                window.location.href = document.querySelector(`a[href^="https://stackoverflow.com/q"]`).getAttribute("href")
                break
            case "www.itranslater.com":
            case "itranslater.com":
                window.location.href = document.querySelector(`a[href^="https://stackoverflow.com:/q"]`).getAttribute("href");
                break
            case "codeday.me":
                window.location.href = document.querySelector(`span.article-es-url:nth-child(4) > a:nth-child(1)`).getAttribute("href")
                break
            case "www.codenong.com":
            case "codenong.com":
                if (window.location.pathname === "/"){
                    throw TypeError
                }
                window.location.href = "https://stackoverflow.com/q"+window.location.pathname
                break
            case "ask.helplib.com":
            case "hant.ask.helplib.com":
                window.location.href = "https://stackoverflow.com/search?q="+document.querySelector(`a.main_title`).getAttribute("oldtitle")
                break
            case "qa.1r1g.com":
                window.location.href = "https://stackoverflow.com/q/"+(+/\d+/.exec(window.location.pathname)[0]-31)/70
                break
            default:
                throw TypeError
        }
    }catch(e){
        console.log("unknown source")
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址