fix(plugins/developer-kit): use indirect eval

This commit is contained in:
PalmDevs 2025-11-12 15:05:50 +07:00
parent 68850ff8fb
commit d9968c6e22
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -54,7 +54,7 @@ function EvalJSAlert() {
try {
if (!api) {
alert(
'Unable to provide plugin API. Running snippet in a second...'
'Unable to provide plugin API. Running snippet in a second...',
)
await sleep(1000)
@ -63,7 +63,7 @@ function EvalJSAlert() {
else globalThis[key] = api
// biome-ignore lint/security/noGlobalEval: Intentional
const res = eval(
const res = (0, eval)(
`var api=${key},{unscoped:revenge}=api;undefined;${code.current}//# sourceURL=Revenge:EvalJS`,
)
@ -118,7 +118,11 @@ function EvalJSAlert() {
<TableRow
label="Inspect depth"
subLabel="The depth of the object to inspect."
trailing={<Text variant="text-sm/normal">{inspectDepth}</Text>}
trailing={
<Text variant="text-sm/normal">
{inspectDepth}
</Text>
}
/>
</TableRowGroup>
<Slider
@ -137,4 +141,4 @@ function EvalJSAlert() {
)
}
export default EvalJSSetting
export default EvalJSSetting