Skip to main content
The no-browser-dialogs rule prevents usage of the following native browser dialog APIs: alert(), confirm(), and prompt().

Rule details

UI extensions run in a sandboxed web worker environment where native browser dialog APIs (alert(), confirm(), and prompt()) are intentionally replaced with error-throwing functions for security reasons. These blocking dialogs would freeze the entire UI and negatively impact user experience. Instead, UI extensions provide non-blocking alternatives that integrate seamlessly with the HubSpot interface.

Dialog method alternatives

Use the following UI extension alternatives instead of browser dialog APIs: See the next section for an example of each alternative.

Examples

Global alerts

Instead of using global alert():
Use actions.addAlert() from the SDK:
Or use the <Alert> component for inline alerts:

Confirmations

Instead of using confirm() as shown below:
Use a combination of <Modal> and <Button> components:

Prompts

Instead of using prompt():
Use a combination of <Modal> and <Input> components:
Last modified on March 29, 2026