You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There is no way to exit widget inspector by keyboard in vscode #2775
This sounds a bit like microsoft/vscode#104329, though that's recently been fixed and I can still repro this in VS Code Insiders. I've added a comment there to see if there's anything specific webviews are supposed to do to pass the keypresses back up to VS Code.
Edit: I tested it with a non-Flutter page, and see the same behaviour, so I don't think it's anything specific to Flutter.
Not sure the priority of this. If this matters we could have DevTools dispatch an event over the VM Service that you can listen to in VSCode to determine when to close DevTools or we could dispatch all key pressed from DevTools over the VMService as that could make it easier for you to keep the keyboard shortcuts consistent with VSCode. Fyi @helin24 to see if keyboard shortcuts for closing tool windows work for DevTools embedded in IntelliJ.
I can't sure whether it's really same issue. I can move editor, open command pallette, close editor by keyboard in release note page. microsoft/vscode#104329 seems to be reproduced in windows, but I don't know that is same to macos.
@jacob314 I made this work with some comments from the linked issues. Usually VS Code handles keypresses for webviews and passes them up to VS Code. When using an iframe, this doesn't work, so the keypress needs to be passed up from the iframe to the parent frame. Due to CORS restrictions, this has to be done via postMessage.
This appears to resolve the issue. Is it reasonable to commit that into DevTools? (note DevTools can only be hosted inside iframes if the server was started with --allow-embed).
I have some security concerns with that. To make it safer can you restrict what is dispatched so not all keyboard events are dispatched and can you only make it apply if a valid vm service url was passed in to the iframe? Otherwise someone could possibly use this to snoop on how a user interacted with devtools by adding the iframe to a malicious webpage.
Activity
kenzieschmoll commentedon Mar 8, 2021
CC @DanTup @jacob314
DanTup commentedon Mar 8, 2021
This sounds a bit like microsoft/vscode#104329, though that's recently been fixed and I can still repro this in VS Code Insiders. I've added a comment there to see if there's anything specific webviews are supposed to do to pass the keypresses back up to VS Code.
Edit: I tested it with a non-Flutter page, and see the same behaviour, so I don't think it's anything specific to Flutter.
jacob314 commentedon Mar 8, 2021
Not sure the priority of this. If this matters we could have DevTools dispatch an event over the VM Service that you can listen to in VSCode to determine when to close DevTools or we could dispatch all key pressed from DevTools over the VMService as that could make it easier for you to keep the keyboard shortcuts consistent with VSCode. Fyi @helin24 to see if keyboard shortcuts for closing tool windows work for DevTools embedded in IntelliJ.
jeiea commentedon Mar 9, 2021
I can't sure whether it's really same issue. I can move editor, open command pallette, close editor by keyboard in release note page. microsoft/vscode#104329 seems to be reproduced in windows, but I don't know that is same to macos.
DanTup commentedon Mar 9, 2021
@jacob314 I made this work with some comments from the linked issues. Usually VS Code handles keypresses for webviews and passes them up to VS Code. When using an iframe, this doesn't work, so the keypress needs to be passed up from the iframe to the parent frame. Due to CORS restrictions, this has to be done via
postMessage.So if I put this into the DevTools index.html:
And then this into the HTML chunk Dart-Code renders with the iframe:
This appears to resolve the issue. Is it reasonable to commit that into DevTools? (note DevTools can only be hosted inside iframes if the server was started with
--allow-embed).jacob314 commentedon Mar 9, 2021
I have some security concerns with that. To make it safer can you restrict what is dispatched so not all keyboard events are dispatched and can you only make it apply if a valid vm service url was passed in to the iframe? Otherwise someone could possibly use this to snoop on how a user interacted with devtools by adding the iframe to a malicious webpage.
Support passing keypresses up to IDEs to enable shortcut keys when em…
Handle keypresses from embedded DevTools iframes
Support passing keypresses up to IDEs to enable shortcut keys when em…
DanTup commentedon Apr 20, 2021
This fix required a change in both the VS Code extension and DevTools, so will show up only after both have been released.