Redirect to Google Translator

Instead of using the small translator on https://google.com get redirected to https://translate.google.com

安裝腳本?
作者推薦腳本

您可能也會喜歡 Precise Time Converter on Google

安裝腳本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Redirect to Google Translator
// @namespace    GoogleTranslatorRedirector
// @version      7
// @description  Instead of using the small translator on https://google.com get redirected to https://translate.google.com
// @author       hacker09
// @include      *://www.google.*
// @icon         https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://translate.google.com/&size=32
// @run-at       document-end
// @grant        none
// @noframes
// ==/UserScript==

(function() {
  'use strict';
  if (document.querySelector("#tw-main") !== null) // If the small translator widget exists on the page
  { //Starts the if conditon
    var Redirect = setTimeout(function() { //Starts the settimeout function
      window.open('https://translate.google.com', '_self'); //Redirect to google translate
    }, 3000); //Redirect to https://translate.google.com in 3 secs

    document.body.insertAdjacentHTML('beforeend', '<div id="Redirect" style="width: 100vw; height: 100vh; z-index: 2147483647; background: rgb(0 0 0 / 36%); position: fixed; top: 0px; font-size: 50px; color: white;"><center>You\'ve 3 secs to click Anywhere if you don\'t want to be redirected</center></div>'); //Show an option to the user

    document.querySelector("#Redirect").onclick = function() { //If anywhere is clicked
      clearTimeout(Redirect); //Stop the redirecting process
      document.querySelector("#Redirect").style.display = 'none'; //Hide the option
    } //Stop the redirection if the user clicks anywhere
  } //Finishes the if conditon
})();