Google Search’s Supported Domains

Makes the list of Google Search’s supported domains available as the global variable “window.SUPPORTED_DOMAINS”.

目前为 2024-04-17 提交的版本。查看 最新版本

// ==UserScript==
// @name               Google Search’s Supported Domains
// @description        Makes the list of Google Search’s supported domains available as the global variable “window.SUPPORTED_DOMAINS”.
// @icon               https://wsrv.nl/?url=https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @author             Jason Kwok
// @namespace          https://jasonhk.dev/
// @version            1.0.0
// @license            MIT
// @match              https://www.google.com/supported_domains
// @run-at             document-end
// @inject-into        page
// @grant              none
// ==/UserScript==

const SUPPORTED_DOMAINS = document.body.textContent.trim().split("\n");

if (GM.info.scriptHandler === "Greasemonkey")
{
    cloneInto(SUPPORTED_DOMAINS, window);
}
else
{
    window.SUPPORTED_DOMAINS = SUPPORTED_DOMAINS;
}