toggle_web_browser_exception()

Client.toggle_web_browser_exception()

Add or remove a domain exception for the in-app web browser.

Usable by Users Bots
Parameters:
  • url (str) – The URL or domain to add/remove as exception.

  • open_external_browser (bool, optional) – Pass True to open this domain in external browser, False to open in-app. Ignored if delete is True.

  • delete (bool, optional) – Pass True to remove the exception for this URL. Defaults to False.

Returns:

bool – True on success.

Example

# Add exception: open in external browser
await app.toggle_web_browser_exception("https://example.com", open_external_browser=True)

# Remove exception
await app.toggle_web_browser_exception("https://example.com", delete=True)