轻小说文库++ 测试模块

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

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

/* eslint-disable no-multi-spaces */
/* eslint-disable userscripts/no-invalid-headers */
/* eslint-disable userscripts/no-invalid-grant */

// ==UserScript==
// @name               test module
// @displayname        轻小说文库++ 测试模块
// @namespace          TestModule-wenku8++
// @version            0.6
// @description        轻小说文库++的测试模块,测试GM存储、@grant、@require、require以及模块环境变量和返回值功能
// @author             PY-DNG
// @license            GPL-license
// @regurl             https?://www\.wenku8\.net/book/\d+\.htm
// @require            https://greasyfork.org/scripts/449412-basic-functions/code/Basic%20Functions.js?version=1080639
// @grant              GM_getValue
// @grant              GM_setValue
// ==/UserScript==

(function __MAIN__() {
    'use strict';
	const alertify = require('alertify');

	GM_setValue('key-name', {
		arr: [0,1,2,3,4],
		obj: {a:0,b:1,c:'text',d:false,e:[{},{},{}]},
		bool: true,
		str: 'text'
	});

	const div = $CrE('div');
	div.innerText = JSON.stringify(MODULE_METADATA + '\n\n' + MODULE_IDENTIFIER + '\n\nMODULE_LOADER' + (typeof MODULE_LOADER === 'object' ? ' = ' + JSON.stringify(MODULE_LOADER) : ' does not exist'));
	div.style.color = 'orange';
	alertify.alert(div);

	exports = {storage: GM_getValue('key-name', {}), status: 200};
})();