Skip to content

Conversation

@kairi003
Copy link

@kairi003 kairi003 commented Dec 19, 2025

Overview

This PR adds support for the default_state option in popup actions (browser_action/page_action for MV2, action for MV3). This option controls the initial enabled/disabled state of the extension's action button, as documented in the Chrome Extension Action API.

Previously, WXT did not support configuring this property in the manifest, making it impossible to set the action button to a disabled state before any runtime methods are called. This PR allows setting the initial state declaratively in the entrypoint options, following the same pattern as the existing options.

Changes

  • Added defaultState property to PopupEntrypointOptions type
  • Updated manifest generation logic to include default_state when specified
  • Updated browser API type definitions to support the property
  • Added comprehensive tests for MV2 and MV3 manifest generation

Manual Testing

Verified in wxt-demo:

  • Added default_state: "disabled" to wxt.config.ts manifest configuration
  • Confirmed TypeScript type checking passes without errors
  • Built the extension and verified default_state property is correctly included in the generated manifest.json

Related Issue

No related issue - this is a standalone enhancement to improve manifest configuration options.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit e7727f5
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/69469642ab3c230007948fba
😎 Deploy Preview https://deploy-preview-2010--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kairi003 kairi003 force-pushed the fix/add-action-default-state branch from c749ae0 to e7727f5 Compare December 20, 2025 12:27
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.

1 participant