Hide extension button when embedded in an IDE - #9956
Conversation
extension on screen, even when embedded in an IDE.
There was a problem hiding this comment.
Code Review
This pull request updates the DevTools scaffold to conditionally show or hide the ExtensionSettingsAction based on the current screen and the embed mode. Specifically, when DevTools is embedded in an IDE (EmbedMode.embedOne), the extension settings action is hidden unless the active screen is an ExtensionScreen or the query parameters specify to hide all except extensions. The changes also include corresponding updates to the status line and comprehensive unit and widget tests to verify this behavior. There are no review comments, and I have no feedback to provide.
_controller_web.dart to prevent browser X-Frame-Options iframe errors during local debugging.
| String get extensionUrl { | ||
| if (debugDevToolsExtensions && !isDevToolsServerAvailable) { | ||
| return 'https://flutter.dev/'; | ||
| return 'data:text/html;charset=utf-8,${Uri.encodeComponent(''' |
There was a problem hiding this comment.
why is this change necessary? Seems like unnecessary work to maintain this custom html rather than just point to something hosted like flutter.dev
There was a problem hiding this comment.
When I was testing locally, the extension didn't show the flutter.dev homepage because there's an HTTP header that prevents embedding it in DevTools properly (I was getting an error screen)
There was a problem hiding this comment.
Is this something we can/should address on the site's firebase config?
There was a problem hiding this comment.
Maybe, but I'd prefer to use this because it doesn't depend on the Flutter website having the right headers (We might change how the site is hosted or configured in the future and this would break again)=
There was a problem hiding this comment.
I think there's an X-Frame-Options header IIRC.
There was a problem hiding this comment.
For anyone testing in the future it would be great to show something like this that indicates that the extension is being displayed properly, rather than showing flutter.dev or a broken iframe.
Hide the extension settings action when DevTools is running in an IDE, unless the current screen is an extension.
This also helps with debugging extensions locally by adding an agent skill, and by fixing an issue where
flutter.dev'sX-Frame-Optionsheader caused a "connection refused" when debugging extensions locally.Fixes #8507