Peacock icon indicating copy to clipboard operation
Peacock copied to clipboard

Plugin context excludes majority of global object variables/methods

Open Yanrishatum opened this issue 5 months ago • 0 comments

Describe the bug Current plugin launcher omits most variables/methods from global object, for example queueMicrotask, setTimeout, setImmediate, setInterval, btoa, atob, structuredClone.

To reproduce The following plugin would not work, due to setTimeout being undefined:

module.exports = function initPlugin() {
  setTimeout(() => console.log(""), 1000);
}

Additional context This is likely an oversight when creating the context for Script.runInContext call to execute the plugin as it overrides global object.

Relevant code segment: https://github.com/thepeacockproject/Peacock/blob/master/components/controller.ts#L1218-L1232

Yanrishatum avatar Jul 13 '25 22:07 Yanrishatum