Просмотр исходного кода

add hint about browser limitations to ui.open (see #1748)

Falko Schindler 1 год назад
Родитель
Сommit
116bb345d0
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      nicegui/functions/open.py

+ 5 - 1
nicegui/functions/open.py

@@ -11,8 +11,12 @@ def open(target: Union[Callable[..., Any], str], new_tab: bool = False) -> None:
     Note that *all* clients (i.e. browsers) connected to the page will open the target URL *unless* a socket is specified.
     User events like button clicks provide such a socket.
 
+    When using the `new_tab` parameter, the browser might block the new tab.
+    This is a browser setting and cannot be changed by the application.
+    You might want to use `ui.link` and its `new_tab` parameter instead.
+
     :param target: page function or string that is a an absolute URL or relative path from base URL
-    :param new_tab: whether to open the target in a new tab
+    :param new_tab: whether to open the target in a new tab (might be blocked by the browser)
     """
     path = target if isinstance(target, str) else globals.page_routes[target]
     client = globals.get_client()