node16
, vm2
模块, 纯js设计一个补环境框架dom解析
弱引用
, 不会影响内存回收问题vscode
插件Code Runner
右键运行lwVm.callListener
(只实现load, 以及鼠标事件, 其他同理, 自己去实现)不用的事件参数对应不同的原型
, 实现之前需要先去浏览器测试明白protectAddIsTrusted
logAddMyLog
QXVM_GENERATE.help
方法, 打印帮助信息默认导出函数 printLog
(runConfig.logOpen=true), 一键导出qxVm
字眼更改
为 lwVm
lw.callListener
// lw.callListener("load")const QXVM_GENERATE = require('../qxVm_sanbox/qxVm.sanbox');const js_code = "function get_form (){ return '' }"; // 导出函数是一定要写的
const user_config = { // 用户配置isTest: true, // 是不是测试状态, 如果是, 则会固定时间戳, 随机数compress: false, // 是否压缩js, 准对检测格式化的网站runConfig: { proxy: false, logOpen: true }, // 运行配置window_attribute: {},env: { // 浏览器环境canvas: "",plugin: [{ description: "Portable Document Format", filename: "internal-pdf-viewer", name: "Chrome PDF Plugin", MimeTypes: [{ description: "Portable Document Format", suffixes: "pdf", type: "application/x-google-chrome-pdf" }] }],navigator: {userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36 Edg/100.0.1185.55"},location: { },document: { referrer: ""}}
}let result = QXVM_GENERATE.QXVm_sanbox(js_code, "get_form", user_config, );
console._form())
user_config
为空不影响运行本文发布于:2024-01-29 19:34:56,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170652809817777.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |