diff --git a/packages/python/plotly/plotly/io/_base_renderers.py b/packages/python/plotly/plotly/io/_base_renderers.py index f5aec7e61cd..f7108f33e96 100644 --- a/packages/python/plotly/plotly/io/_base_renderers.py +++ b/packages/python/plotly/plotly/io/_base_renderers.py @@ -666,6 +666,11 @@ def open_html_in_browser(html, using=None, new=0, autoraise=True): if isinstance(html, six.string_types): html = html.encode("utf8") + if isinstance(using, tuple): + using = [i for i in webbrowser._browsers.keys() if any(j in i for j in using)] + if using: + using = using[0] + class OneShotRequestHandler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) diff --git a/packages/python/plotly/plotly/io/_renderers.py b/packages/python/plotly/plotly/io/_renderers.py index 90deed22a39..0abd0618ec9 100644 --- a/packages/python/plotly/plotly/io/_renderers.py +++ b/packages/python/plotly/plotly/io/_renderers.py @@ -438,9 +438,10 @@ def show(fig, renderer=None, validate=True, **kwargs): # External renderers["browser"] = BrowserRenderer(config=config) -renderers["firefox"] = BrowserRenderer(config=config, using="firefox") -renderers["chrome"] = BrowserRenderer(config=config, using="chrome") -renderers["chromium"] = BrowserRenderer(config=config, using="chromium") +renderers["firefox"] = BrowserRenderer(config=config, using=("firefox")) +renderers["chrome"] = BrowserRenderer(config=config, using=("chrome", "google-chrome")) +renderers["chromium"] = BrowserRenderer(config=config, using=("chromium", "chromium-browser")) +renderers["opera"] = BrowserRenderer(config=config, using=("opera")) renderers["iframe"] = IFrameRenderer(config=config, include_plotlyjs=True) renderers["iframe_connected"] = IFrameRenderer(config=config, include_plotlyjs="cdn") renderers["sphinx_gallery"] = SphinxGalleryHtmlRenderer()