url (str) – The url to open, e.g. 'http://python.org'. To open a
local file use 'file://...'.

runtime (str) – The runtime(s) to use. E.g. ‘app’ will open in a
desktop-app-like runtime, ‘browser’ in a browser runtime. One can
target specific runtimes, e.g. ‘nw-app’ or ‘edge-browser’, or
a selection, e.g. ‘chrome-browser or firefox-browser’. Default
is 'apporbrowser'.
See below for more information on available runtimes.

kwargs – addition arguments specific to the runtime. See the
docs of the runtime classes.

Returns:

An object that represents the runtime. For
Desktop runtimes it can be used to close the runtime.

browser: open in a browser. Firefox, Chrome and Edge are prefered over
the default browser.

default-browser: open in the system default browser.

firefox-browser: open in Firefox browser.

chrome-browser: open in Chrome/Chromium browser.

googlechrome-browser or chromium-browser: like chrome-browser, but specific.

edge-browser: open in Microsoft Edge browser.

ie-browser: open in Microsoft Internet Explorer browser.

xx-browser: use webbrowser module to open in browser “xx”.

App runtimes:

app: open as desktop app, using firefox-app or nw-app
(and chrome-app on Windows).

firerox-app: open as desktop app, using Firefox’ app framework (Xul).

nw-app: open as desktop app using NW.js.

chrome-app: open as desktop-like app via Chrome/Chromium (only works well
on Windows).

pyqt-app: open as desktop-like app using PyQt/PySide.

The most developed app runtimes are Firefox and NW. The former requires
the user to have Firefox installed. The latter can be installed by the user
simply by downloading the archive. Firefox is lighter (memory-wise), while
NW is based on Chromium, making it heavier. The other
app runtimes are useful for testing or development, but should generally be
avoided when distributing apps.

Runtime based on Mozilla Firefox. Can be used to open an app in
Firefox, as well as launch desktop-like apps via Mozilla’s XUL framework.
Available if Firefox is installed.

This runtime is visible in the task manager under a custom process name
(sys.executable+'-ui'), making it easy to spot in the task manager,
and avoids task-bar grouping. Compared to the NW runtime, this runtime
is leaner in terms of memory and number of processes, and is also faster.

Desktop runtime based on NW.js (http://nwjs.io, formerly
node-webkit), which uses the Chromium engine. We will install/update the
runtime if it finds a suitable archive in a few common locations like
the desktop, download dir and temp dir. That way, the end-user only
has to download the archive to make this runtime work.

This runtime is visible in the task manager under a custom process name
(sys.executable+'-ui'), making it easy to spot in the task manager,
and avoids task-bar grouping. Compared to the Firefox app runtime,
this runtime uses more processes and memory. Chrome used to be faster, but
since Firefox Quantum this is no longer the case.

Runtime based on the Python webbrowser module. This runtime is used
to open a url in the system default browser, and to attempt to handle a
given browser name that is unknown to the webruntime module (maybe
the webbrowser module knows it).