@blockly/plugin-cross-tab-copy-paste not working from different domains

41 views
Skip to first unread message

Daniel De La Rosa

unread,
Feb 5, 2025, 8:04:40 AMFeb 5
to Blockly
Hello! 

We've been using the plugin @blockly/plugin-cross-tab-copy-paste for months now and we were able to copy blocks from one domain to another (i.e.: from our stage environment to our prod environment). As of last week that functionality has stopped. Our engineers use this feature a lot.

Can someone tell me why is that happening? Is that a bug?  Is this occurring to anyone else?

Thanks,

Daniel

Aaron Dodson

unread,
Feb 5, 2025, 8:57:04 AMFeb 5
to Blockly
Hi,

We haven't changed anything in the plugin, and I'm sort of shocked this ever worked. The plugin uses localstorage, which is (and AFAIK, always has been) scoped per-host. From a brief look I don't see any ability to relax that restriction with CORS or CSP either. The plugin could perhaps be refactored to use postMessage and take allowed domains as an argument, although that would require the receiving tab to be open when the copy occurs to receive the message. I don't think we'd want to wholesale switch to that, but if this is important for your workflow it's probably the most straightforward approach..

- Aaron

Daniel De La Rosa

unread,
Mar 11, 2025, 9:06:29 AM (24 hours ago) Mar 11
to Blockly
Hi Aaron. Thanks for your response! I was mistaken, and it never worked across domains. However, this is a feature that we would REALLY appreciate since we have huge block chains that we need to transfer between our testing environments. Would it be possible to include that in a future release?

Aaron Dodson

unread,
Mar 11, 2025, 3:31:27 PM (17 hours ago) Mar 11
to Blockly
We'd certainly welcome a PR adding support, whether through postmessage or some other mechanism. I filed https://github.com/google/blockly-samples/issues/2496 as a tracking bug; the core team is pretty focused on accessibility initiatives at the moment, but it's a reasonable request.

- Aaron

Reply all
Reply to author
Forward
0 new messages