Closed ross-inksmith closed 1 year ago
By design, all injected iframe need to be allowed through the pxttarget.json configuration and vetted by the MakeCode team. I would recommend moving this question to the https://github.com/microsoft/pxt-microbit repo.
We would like to customize the
makecode-editor-extension
andmakecode-simulator
as provided by jacdac-docs, but we are having trouble making these changes work outside the local environment. The issue seems to be that there isn't yet a way to make the simulator iframe source from a different url.What changes I have made so far do work locally when using
?localeditorextensions=1&localhostmessagesims=1
. Hosting ourjacdac-docs
fork on github.io in the same manner as [microsoft.github.io/jacdac-docs]() works locally withpxt-microbit
whentargetconfig.json
andsimulator.messageSimulators.jacdac.url
inpxtarget.json
were updated with the fork's url.Obviously changing the current jacdac url in
pxtarget
in production for us is out of the question, but there doesn't appear to be an existing way to configure it from the package.So far I've also tried creating a new item in
simulator.messageSimulators
and updating our fork ofpxt-jacdac
to use that as the type/channel, but sendCustomEventAsync checks specifically for a "jacdac" type and therefore throws an error. Given that the simulator is spawned based on the "channel" of the message, I've tried making the extension emmit "jacdac" type messages on a differently named channel but I'm not sure if there's an actual distinction between these fields since they get used Interchangeably.I'm looking on some guidance on how best make the iframe simulator configurable.