-
-
Notifications
You must be signed in to change notification settings - Fork 194
feat: add onLoad and onClose to iframe custom tab #890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for vue-devtools-docs canceled.
|
@vue/devtools-applet
@vue/devtools-core
@vue/devtools-api
@vue/devtools
@vue/devtools-kit
vite-plugin-vue-devtools
commit: |
This doesn't work yet because the callbacks are lost (probably during serialization). There should be some communication up but I don't know where it is. The iframe can be accessed even if it's nested (e.g. |
Oh, yep. We need to handle the communication. I'll handle it. |
Hi @posva , It's a lit be hard to pass the iframe instance to the user app side. If we use tab name instead of it, can it cover your use case? For example: addCustomTab({
name: 'pinia-colada',
title: 'Pinia Colada',
icon: 'https://pinia-colada.esm.dev/logo.svg',
view: {
type: 'iframe',
src: '/__pinia-colada-devtools',
persistent: false,
onLoad(name) {
console.log(name) // 'pinia-colada',
},
onClose(name) {
console.log(name) // 'pinia-colada',
},
},
category: 'modules',
}) |
Why is it hard? Are they cases where the iframe can't be transferred? I suppose the case with the standalone devtools doesn't work because the devtools are not created by the main document but that's fine: with time a more powerful approach will be document pip Having access to the iframe element is needed to establish the communication between the two documents. |
That's because the current communication way design, which we have in ![]() |
Yeah, I see. That's unfortunate. In my Pinia Colada devtools I use the messaging API and a custom |
Yeah. If we only consider iframe hosts, it would be relatively easy to implement, but things get more complex and difficult in browser extension or |
Then maybe there should be a callback in the add custom tab function that allows remote procedures to the iframe. Or any other method of communicating between the main app and the iframe added to the devtools |
to allow custom integrations with iframes without compromising on a high level API yet: