forked from scratchfoundation/scratch-vm
-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Expected Behavior
When loading a sandboxed extension with a defined dynamic menu, the dynamic menu should work as expected.
Actual Behavior
All the blocks in the block panel stack together at the top of the panel (which isn't important, as it is caused by the following problem), and the console throws the error Uncaught TypeError: e[t] is undefined
. The problem came from the function _getExtensionMenuItems
. It takes as argument argumentObject
, and menuItemFunctionName
. It tries to access the function with extensionObject[menuItemFunctionName]
, but when the extension is sandboxed, this does not exist. The function name is correct. Loading the extension in unsandboxed mode works.
Steps to Reproduce
Load the following extension :
class Extension {
getInfo() {
return {
id: "extension",
name: "Extension",
blocks: [
{
opcode: "block",
blocktype: "command",
text: "A block with an argument : [ARG]",
arguments: {
ARG: {
type: "string",
menu: "extensionMenu"
}
}
}
],
menus: {
extensionMenu: {
items: "extensionMenuFunction"
}
}
}
}
block() {
console.log("Hello world!")
}
extensionMenuFunction() {
return ["Hello", "world", "!"]
}
}
Scratch.extensions.register(new Extension())
Operating System and Browser
Firefox 131.0.3 (64-bit) - Windows 11 24H2
Metadata
Metadata
Assignees
Labels
No labels