If no indexURL is provided, we throw and catch an error and
then use ErrorStackParser to calculate where pyodide.js has
been loaded from. Resolves #2290.
ENH Calculate indexURL from error stack trace. If no indexURL is provided, we throw and catch an error and
then use ErrorStackParser to calculate where pyodide.js has
been loaded from. Resolves #2290.
#! /usr/bin/env python3

"""
An implementation of the standard library webbrowser module to open webpages.
Since we're already running a webbrowser, it's really simple...
"""


def open(url, new=0, autoraise=True):
    from js import window

    window.open(url, "_blank")


def open_new(url):
    return open(url, 1)


def open_new_tab(url):
    return open(url, 2)

#! /usr/bin/env python3

"""
An implementation of the standard library webbrowser module to open webpages.
Since we're already running a webbrowser, it's really simple...
"""


def open(url, new=0, autoraise=True):
    from js import window

    window.open(url, "_blank")


def open_new(url):
    return open(url, 1)


def open_new_tab(url):
    return open(url, 2)
