Skip to content

Hide extension button when embedded in an IDE - #9956

Open
johnpryan wants to merge 6 commits into
flutter:masterfrom
johnpryan:fix-8507
Open

Hide extension button when embedded in an IDE#9956
johnpryan wants to merge 6 commits into
flutter:masterfrom
johnpryan:fix-8507

Conversation

@johnpryan

@johnpryan johnpryan commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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's X-Frame-Options header caused a "connection refused" when debugging extensions locally.

Fixes #8507

@johnpryan
johnpryan requested a review from a team as a code owner August 10, 2026 23:46
@johnpryan
johnpryan requested review from bkonyi and removed request for a team August 10, 2026 23:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@johnpryan
johnpryan requested review from kenzieschmoll and removed request for bkonyi August 11, 2026 16:21
String get extensionUrl {
if (debugDevToolsExtensions && !isDevToolsServerAvailable) {
return 'https://flutter.dev/';
return 'data:text/html;charset=utf-8,${Uri.encodeComponent('''

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change necessary? Seems like unnecessary work to maintain this custom html rather than just point to something hosted like flutter.dev

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@parlough parlough Aug 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we can/should address on the site's firebase config?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)=

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an X-Frame-Options header IIRC.

@johnpryan johnpryan Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevTools extensions menu button does not need to show when in embed mode embedOne

3 participants