google-search-supported-domains

Exposes the list of Google Search’s supported domains as the constant “SUPPORTED_DOMAINS”.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/492742/1361711/google-search-supported-domains.js

  1. // ==UserScript==
  2. // @name google-search-supported-domains
  3. // @description Exposes the list of Google Search’s supported domains as the constant “SUPPORTED_DOMAINS”.
  4. // @author Jason Kwok
  5. // @namespace https://jasonhk.dev/
  6. // @version 1.0.0
  7. // @license MIT
  8. // ==/UserScript==
  9.  
  10. if (location.href !== "https://www.google.com/supported_domains")
  11. {
  12. throw new Error("Invalid URL.");
  13. }
  14.  
  15. const SUPPORTED_DOMAINS = document.body.textContent.trim().split("\n");