window.confirm()
Returns: boolean
- true If OK button is pressed and false when Cancel button is pressed.
Since: v7.0.0
Displays a Confirm message dialog putting the application in a modal state while not blocking the Javascript thread and still allowing processing of events in the main event loop.
UXP behaviour is different from the standard behaviour of blocking the javascript thread of execution until the dialog has been dismissed.
The following are additional simple alerts supported by UXP
Param | Type | Description |
---|---|---|
message | string | A string you want to display in the confirmation dialog. |
Example
Note: 1. Since UXP v7.4, `confirm()` can only be invoked in `plugin` via the featureFlags `enableAlerts`. Update your Manifest v5 with the followingCopied to your clipboardconfirm("This is confirmation message");
Copied to your clipboard"featureFlags": {"enableAlerts": true}
- Since UXP v7.4,
confirm()
is disabled forscripts