Hello,
I’m trying to send a message from code.js to ui.html but I’m getting the following error message: “Blocked a frame with origin ‘null’ from accessing a cross-origin frame.” Sending messages from the UI to code.js (which is my backend), works fine.
code.html
figma.ui.onmessage = msg => {
if (msg.type === 'importSvg') {
const vectorNode = figma.currentPage.selection[0];
console.log(vectorNode);
figma.ui.postMessage({ type: 'vectorNode',vectorNode});
}
};
ui.html
parent.onmessage = msg => {
if (msg.type === 'vectorNode') {
console.log(msg.vectorNode);
}
};
Thank you