轻小说文库++ 测试模块

轻小说文库++的测试模块,测试GM存储和其他grant,以及模块返回值功能

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/449306/1085877/%E8%BD%BB%E5%B0%8F%E8%AF%B4%E6%96%87%E5%BA%93%2B%2B%20%E6%B5%8B%E8%AF%95%E6%A8%A1%E5%9D%97.js

  1. /* eslint-disable no-multi-spaces */
  2. /* eslint-disable userscripts/no-invalid-headers */
  3. /* eslint-disable userscripts/no-invalid-grant */
  4.  
  5. // ==UserScript==
  6. // @name test module
  7. // @displayname 轻小说文库++ 测试模块
  8. // @namespace TestModule-wenku8++
  9. // @version 0.6
  10. // @description 轻小说文库++的测试模块,测试GM存储、@grant、@require、require以及模块环境变量和返回值功能
  11. // @author PY-DNG
  12. // @license GPL-license
  13. // @regurl https?://www\.wenku8\.net/book/\d+\.htm
  14. // @require https://gf.qytechs.cn/scripts/449412-basic-functions/code/Basic%20Functions.js?version=1080639
  15. // @grant GM_getValue
  16. // @grant GM_setValue
  17. // ==/UserScript==
  18.  
  19. (function __MAIN__() {
  20. 'use strict';
  21. const alertify = require('alertify');
  22.  
  23. GM_setValue('key-name', {
  24. arr: [0,1,2,3,4],
  25. obj: {a:0,b:1,c:'text',d:false,e:[{},{},{}]},
  26. bool: true,
  27. str: 'text'
  28. });
  29.  
  30. const div = $CrE('div');
  31. div.innerText = JSON.stringify(MODULE_METADATA + '\n\n' + MODULE_IDENTIFIER + '\n\nMODULE_LOADER' + (typeof MODULE_LOADER === 'object' ? ' = ' + JSON.stringify(MODULE_LOADER) : ' does not exist'));
  32. div.style.color = 'orange';
  33. alertify.alert(div);
  34.  
  35. exports = {storage: GM_getValue('key-name', {}), status: 200};
  36. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址