Google访问小助理Assistant,谷歌免费上网浏览冲浪好帮手

一个纯净好用的谷歌搜索访问助手 - Google访问小助理Assistant,谷歌免费上网冲浪好帮手,解决谷歌无法访问,Google上不去怎么办,Google打不开的解决办法,解决Google无法访问+加速工具,可以访问谷歌搜索、谷歌邮箱Gmail、谷歌地图、谷歌云盘、谷歌翻译、谷歌学术、谷歌文档、以及谷歌地球等字母表(Alphabet)旗下众多产品!谷歌高效搜索引擎辅助增强,在搜索时一键切换Google搜索引擎/Google镜像/谷歌镜像/谷歌翻页,就能享受极速访问的快感!

// ==UserScript==
// @name         Google访问小助理Assistant,谷歌免费上网浏览冲浪好帮手
// @namespace    Google-Access-Assistant
// @version      1.0.7
// @description  一个纯净好用的谷歌搜索访问助手 - Google访问小助理Assistant,谷歌免费上网冲浪好帮手,解决谷歌无法访问,Google上不去怎么办,Google打不开的解决办法,解决Google无法访问+加速工具,可以访问谷歌搜索、谷歌邮箱Gmail、谷歌地图、谷歌云盘、谷歌翻译、谷歌学术、谷歌文档、以及谷歌地球等字母表(Alphabet)旗下众多产品!谷歌高效搜索引擎辅助增强,在搜索时一键切换Google搜索引擎/Google镜像/谷歌镜像/谷歌翻页,就能享受极速访问的快感!
// @author       Google-Access-Assistant
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACVVBMVEUAAABChPRChfRBhvVChfRChPU0qFM0qFPqQzX/1ADqQzTqQzXqQzXqQzU2qFMOpGI0qFLqQjVChfQzp1LqQzRChfXqQjXrQzXqQzU1qFQ0qVPqQzT5vARBhPU1qFNChPTpQzTrRDVAg/U0qk/qRDTsRTQzqlJChvfpQDMzqFJFfv/nKj7qQzUYpV7oMDwzq0hChfT9vAPFuBn3nxBAid/zfx01qlX9vgJChfU0qFPqQzX7vQX8vAUzplL+vgT7vAQ0qFTqQjM1rlU2qFT8uwPqQjbrQzUzqVM0pVjqQzQ0qFPrQjXrRDRBhPQ1qFTpQjbrQjfnLT5BgvI4qFE+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JsWQEEDVWJA3gqlaOC4GKiSFUhEA+fFQJl0kIwPVAS7SBbH7yeSwf7S0X78l+IQGngh+JOsRyWDiPYIP9kKIXAOULZ4/EVrSgbmv4VgVIiB27i/s8WxfHXcJ6stPZj/SPRNRYDy1M4ff0Ucy2O7C3h2iX4y7oPg2FAyYGU9zMb6uSaRC5jxg5/88VkvUbhCgcKEbICw45uVFTDfAJTLAf4pwPGc9WNzKXWSoe5AT79JSCjaAUs6K0FZb/QN9PVKc++yKeN6FF7/GuD5kMRKia9Mz8g4oUyKt7Fmc+/EjUv6FMgrQNCzBMzfF25a1c8X5hVBUHTEgmtw/dAaBUCgOYpU4NdY0JcLRFqTiIf4MXgPKHQcJARs5Y+BTm3wNWregxyMGfEY2cXuiQW56HMqUT/qGKLTaM5Rlovy9pqGDggdY2zD9Ys5tTdjW2GEYc5/4O/sFPfWmfIAAAAASUVORK5CYII=
// @require      http://cdn.staticfile.org/jquery/1.12.0/jquery.min.js
// @supportURL   http://letsmain.com/google-access-master?utm_source=greasyfork-recommend
// @include      *://*.abc.xyz/*
// @include      *://*.google.com/*
// @include      *://*.google.com.hk/*
// @match        *://www.google.com/*
// @match        *://mail.google.com/*
// @match        *://maps.google.com/*
// @match        *://play.google.com/*
// @match        *://drive.google.com/*
// @match        *://translate.google.com/*
// @match        *://scholar.google.com/*
// @match        *://docs.google.com/*
// @match        *://earth.google.com/*
// @include      *://*.bing.com/*
// @include      *://*.yandex.com/*
// @include      *://*.duckduckgo.com/*
// @include      *://*.baidu.com/*
// @include      *://*.sogou.com/*
// @include      *://*.so.com/*
// @include      *://*.sm.cn/*
// @include      *://*.startpage.com/*
// @include      *://*.fsoufsou.com/*
// @include      *://*.deepl.com/*
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_download
// @grant        GM_addStyle
// @grant        GM_openInTab
// @grant        unsafeWindow
// @run-at       document-idle
// @run-at       document-start
// @grant        GM_setClipboard
// @grant        GM_getResourceURL
// @grant        GM_getResourceURL
// @grant        GM_getResourceText
// @grant        GM_xmlhttpRequest
// @antifeature  payment
// @compatible	 Chrome
// @compatible	 Edge
// @compatible	 Firefox
// @compatible	 Safari
// @compatible	 Opera
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    var $ = window.jQuery;
    if (!$) {
        var script = document.createElement('script');
        script.src = 'https://code.jquery.com/jquery-3.6.1.min.js';
        document.head.appendChild(script);
        $ = window.jQuery;
    }
    var currentUrl = window.location.href;
    var currentHost = window.location.host;
    var resourceAnalysis = {};
    resourceAnalysis.addHtml = function() {
        var logoImgUrl = GM_getResourceURL('logo');
        var floatBoxHtml = '<div style="position:fixed;z-index:1076134;cursor:pointer;top:68px;left:0px;">' +
            '<div id="access-helper-wrap" style="width:136px;height:28px;line-height:28px;text-align:center;font-size:12px;color:#fff;background-color:#7C3AED;border:1px solid #7C3AED;border-left:none;border-top-right-radius:5px;border-bottom-right-radius:5px;">' +
            '<img src="' + logoImgUrl + '" style="width:20px;height:20px;position:relative;top:5px;" />&nbsp;Google访问助手' +
            '</div>' +
            '<div id="access-helper-url-wrap" style="font-size:12px;padding:6px 4px;">' +
            '<a href="http://letsmain.com/google-access-master?utm_source=greasyfork-recommend" target="_blank" style="color:#3b8cff;text-decoration:none">http://letsmain.com/google-access-master</a>' +
            '</div>' +
            '</div>';
        $('body').append(floatBoxHtml);
        var defaultVipUrl = 'http://letsmain.com/google-access-master?utm_source=greasyfork-recommend&invitation-code=#';
        $('body').on('click', '#access-helper-wrap', function() {
            defaultVipUrl = defaultVipUrl.replace(/#/g, encodeURIComponent(currentUrl));
            window.open(defaultVipUrl, '_blank');
        });
    };
    resourceAnalysis.init = function() {
        resourceAnalysis.addHtml();
    };
    resourceAnalysis.init();
    const options = {
        hookEvents: ["contextmenu", "select", "selectstart", "copy", "cut", "dragstart"],
        unhookEvents: ["mousedown", "mouseup", "keydown", "keyup"],
        doms: true,
        hookAddEventListener: true,
        hookPreventDefault: true,
        addCss: true,
        iframeSrc: "about:blank",
    };
    const shouldNotHook = (event) => !!event.closest("form");
    const clearEvents = () => {
        const targets = [
                document,
                document.body,
                ...document.getElementsByTagName("div"),
            ];
        const iframe = document.querySelector(`iframe[src="${options.iframeSrc}"]`);
        if (
            iframe &&
            iframe.clientWidth > 99 &&
            iframe.clientHeight > 11
        ) {
            targets.push(
                iframe.contentWindow.document,
                iframe.contentWindow.document.body
            );
        }
        for (const target of targets) {
            if (!target) continue;
            for (const eventType of options.hookEvents.concat(options.unhookEvents)) {
                const prop = "on" + eventType;
                target[prop] = null;
            }
        }
    };
    const hookEvents = (originalAddEventListener) => {
        const newAddEventListener = function (type, listener, options) {
            const useCapture =
                typeof options === "boolean" ? options : options && options.capture;
            if (!options.hookEvents.includes(type)) {
                originalAddEventListener.call(this, type, listener, useCapture);
            } else {
                originalAddEventListener.call(this, type, (e) => {
                    if (shouldNotHook(e) || !options.hookEvents.includes(e.type)) {
                    e.preventDefault();
                } else {
                    listener(e);
                }
            }, useCapture);
        }
    };
    EventTarget.prototype.addEventListener = newAddEventListener;
    document.addEventListener = newAddEventListener;
};
const hookPreventDefault = (originalPreventDefault, eventNames) => {
    Event.prototype.preventDefault = function () {
        if (shouldNotHook(this) || !eventNames.includes(this.type)) {
            originalPreventDefault.call(this);
        }
    };
};
const addCss = () => {
    GM_addStyle(`
    html, * {
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        user-select: text !important;
    }

::-moz-selection {
        color: #FFF!important;
        background: #3399FF!important;
    }

::selection {
        color: #FFF!important;
        background: #3399FF!important;
    }
  `);
};
const init = () => {
    if (options.doms) {
        setInterval(clearEvents, 9000);
        setTimeout(clearEvents, 1000);
        window.addEventListener("load", clearEvents, true);
    }
    if (options.hookAddEventListener) {
        hookEvents(EventTarget.prototype.addEventListener);
    }
    if (options.hookPreventDefault) {
        hookPreventDefault(
            Event.prototype.preventDefault,
            options.hookEvents.concat(options.unhookEvents)
        );
    }
    if (options.addCss) {
        addCss();
    }
};
init();
})();