vm 即将在渲染进程内被禁用,改用简单的沙箱执行命令

This commit is contained in:
fofolee
2022-04-18 17:41:04 +08:00
parent 24d0dd1e2a
commit a27fe4c338
12 changed files with 111 additions and 3422 deletions

53
plugin/lib/nodeFns.js Normal file
View File

@@ -0,0 +1,53 @@
const nodeFns = {
AbortController,
AbortSignal,
Array,
ArrayBuffer,
Boolean,
Buffer,
DataView,
Date,
Error,
EvalError,
Float32Array,
Float64Array,
Function,
Infinity,
Int16Array,
Int32Array,
Int8Array,
Intl,
JSON,
Math,
NaN,
Number,
Object,
RangeError,
ReferenceError,
RegExp,
String,
SyntaxError,
TypeError,
URIError,
URL,
URLSearchParams,
Uint16Array,
Uint32Array,
Uint8Array,
Uint8ClampedArray,
atob,
btoa,
decodeURI,
decodeURIComponent,
encodeURI,
encodeURIComponent,
escape,
isFinite,
isNaN,
parseFloat,
parseInt,
require,
unescape,
};
module.exports = nodeFns