🏠 

Store Variable Example

Stores a variable using Tampermonkey's storage functions


安装此脚本?
  1. // ==UserScript==
  2. // @name Store Variable Example
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0
  5. // @license MIT
  6. // @description Stores a variable using Tampermonkey's storage functions
  7. // @author You
  8. // @match https://chatgpt.com/c/6701c622-1fe0-8011-8174-0ac428d929e3
  9. // @grant GM_setValue
  10. // @grant GM_getValue
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. // Store the value "hee"
  15. GM_setValue("myVariable", "hi");
  16. // Retrieve and log the stored value
  17. let storedValue = GM_getValue("myVariable");
  18. console.log("Stored value:", storedValue);
  19. })();