Skip to content

UrlLauncher

UrlLauncher #

Bases: Service

data #

data: Any = skip_field()

Arbitrary data of any type.

key #

key: KeyValue | None = None

page #

page: Page | PageView | None

The page (of type Page or PageView) to which this control belongs to.

parent #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

before_event #

before_event(e: ControlEvent)

before_update #

before_update()

This method is called every time when this control is being updated.

Note

Make sure not to call/request an update() here.

build #

build()

Called once during control initialization to define its child controls. self.page is available in this method.

can_launch_url_async #

can_launch_url_async(url: str | Url) -> bool

Checks whether the specified URL can be handled by some app installed on the device.

PARAMETER DESCRIPTION
url

The URL to check.

TYPE: str | Url

RETURNS DESCRIPTION
bool

True if it is possible to verify that there is a handler available.

bool

False if there is no handler available,

bool

or the application does not have permission to check. For example:

bool
  • On recent versions of Android and iOS, this will always return False unless the application has been configuration to allow querying the system for launch support.
bool
  • On web, this will always return False except for a few specific schemes that are always assumed to be supported (such as http(s)), as web pages are never allowed to query installed applications.

close_in_app_web_view #

close_in_app_web_view() -> None

close_in_app_web_view_async #

close_in_app_web_view_async() -> None

did_mount #

did_mount()

init #

init()

is_isolated #

is_isolated()

launch_url #

launch_url(
    url: str | Url,
    *,
    web_popup_window_name: str | UrlTarget | None = None,
    web_popup_window: bool = False,
    web_popup_window_width: int | None = None,
    web_popup_window_height: int | None = None,
) -> None

Opens a web browser or popup window to a given url.

PARAMETER DESCRIPTION
url

The URL to open.

TYPE: str | Url

web_popup_window_name

Window tab/name to open URL in.

TYPE: str | UrlTarget | None DEFAULT: None

web_popup_window

Whether to open the URL in a browser popup window.

TYPE: bool DEFAULT: False

web_popup_window_width

Popup window width.

TYPE: int | None DEFAULT: None

web_popup_window_height

Popup window height.

TYPE: int | None DEFAULT: None

launch_url_async #

launch_url_async(
    url: str | Url,
    *,
    web_popup_window_name: str | UrlTarget | None = None,
    web_popup_window: bool = False,
    web_popup_window_width: int | None = None,
    web_popup_window_height: int | None = None,
) -> None

Opens a web browser or popup window to a given url.

PARAMETER DESCRIPTION
url

The URL to open.

TYPE: str | Url

web_popup_window_name

Window tab/name to open URL in.

TYPE: str | UrlTarget | None DEFAULT: None

web_popup_window

Whether to open the URL in a browser popup window.

TYPE: bool DEFAULT: False

web_popup_window_width

Popup window width.

TYPE: int | None DEFAULT: None

web_popup_window_height

Popup window height.

TYPE: int | None DEFAULT: None

update #

update() -> None

will_unmount #

will_unmount()