diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6e70764f..bd5cbe99 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 4.3 + +_Released 30/08/2023_ + +### ⚡ Features + +- [All] `webview.create_window(maximized=False)` Create a window in a maximized state. Thanks @vsajip +- [All] `webview.create_window(screen=screen_instance)` Create a window on a specific monitor, where `screen` is a screen returned by `window.screens`. Thanks @louisnw01 +- [All] Window title can be obtained / set via `window.title`. + +### 🚀 Improvements + +- [All] Window closing event fired after closing confirmation #1178. Thanks @p4bl0- +- [All] Improve performance of JS API calls by removing the initial delay of 100ms. +- [GTK] Native JS Bridge. HTTP server based JS bridge is removed. +- [GTK] Remove support for Webkit older than 2.2 + +### 🐞 Bug fixes + +- [All] Easy drag memory leak #1176 +- [Winforms] Easy drag support #1125 +- [Winforms] Incorrect DPI scaling +- [Winforms] Private mode not working if `webview.screens` is returned before `webview.start` #1193 +- [QT] Add no sandbox for arch/manjaro/nixos to avoid white screen problem #890. Thanks @myuanz +- [GTK] Closing event handlers cancellation. Thanks @p4bl0- +- [GTK] SEGFAULT on second `webview.start()` call #1063. Thanks @PercentBoat4164 + ## 4.2.2 _Released 25/06/2023_ @@ -44,8 +71,7 @@ _Released 02/05/2023_ - [All] JS API exceptions are now printed both in Python and Javascript consoles. - [All] Hide menu bar when there is no menu. Thanks @Joffreybvn - -### 🐞 Bug fixes +### ⚡ Features - [All] Fix bug where http_port was not being forwarded to the actual window #1060. Thanks @robb-brown - [All] Switch from tempfile to os.devnull to fix PyInstaller issue. Thanks @simonrob diff --git a/docs/README.md b/docs/README.md index 7f748515..dcbe0d9d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,7 +7,7 @@ actionLink: /guide/ footer: BSD Licensed | Copyright © 2014–present Roman Sirokov ---
-Current version: 4.2.2
+Current version: 4.3
What's new
diff --git a/docs/guide/api.md b/docs/guide/api.md index 4e7e3248..219a414b 100644 --- a/docs/guide/api.md +++ b/docs/guide/api.md @@ -5,9 +5,9 @@ ``` python webview.create_window(title, url=None, html=None, js_api=None, width=800, height=600, - x=None, y=None, resizable=True, fullscreen=False, min_size=(200, 100), + x=None, y=None, screen=None, resizable=True, fullscreen=False, min_size=(200, 100), hidden=False, frameless=False, easy_drag=True, focus=True, - minimized=False, on_top=False, confirm_close=False, background_color='#FFFFFF', + minimized=False, maximized=False, on_top=False, confirm_close=False, background_color='#FFFFFF', transparent=False, text_select=False, zoomable=False, draggable=False, server=http.BottleServer, server_args={}, localization=None) ``` @@ -22,6 +22,7 @@ Create a new _pywebview_ window and returns its instance. Window is not shown un * `height` - Window height. Default is 600px. * `x` - Window x coordinate. Default is centered. * `y` - Window y coordinate. Default is centered. +* `screen` - Screen to display window on. `screen` is a screen instance returned by `webview.screens`. * `resizable` - Whether window can be resized. Default is True * `fullscreen` - Start in fullscreen mode. Default is False * `min_size` - a (width, height) tuple that specifies a minimum window size. Default is 200x100 @@ -29,7 +30,8 @@ Create a new _pywebview_ window and returns its instance. Window is not shown un * `frameless` - Create a frameless window. Default is False. * `easy_drag` - Easy drag mode for frameless windows. Window can be moved by dragging any point. Default is True. Note that easy_drag has no effect with normal windows. To control dragging on an element basis, see [drag area](/guide/api.html#drag-area) for details. * `focus` - Create a non-focusable window if False. Default is True. -* `minimized` - Start in minimized mode +* `minimized` - Display window minimized +* `maximized` - Display window maximized * `on_top` - Set window to be always on top of other windows. Default is False. * `confirm_close` - Whether to display a window close confirmation dialog. Default is False * `background_color` - Background color of the window displayed before WebView is loaded. Specified as a hex color. Default is white. @@ -136,6 +138,13 @@ Get display width. Represents a window that hosts webview. `window` object is returned by `create_window` function. +## window.title +``` python +window.title +``` + +Get or set title of the window + ## window.on_top ``` python diff --git a/docs/guide/renderer.md b/docs/guide/renderer.md index 58cdcb97..9e6794a1 100644 --- a/docs/guide/renderer.md +++ b/docs/guide/renderer.md @@ -5,15 +5,14 @@ The following renderers are used on each platform | Platform | Code | Renderer | Provider | Browser compatibility | |----------|--------------|----------|---------------------------------------------------|-----------------------| -| GTK | gtk | WebKit | WebKit2 | | +| GTK | gtk | WebKit | WebKit2 (minimum version >2.2) | | | macOS | | WebKit | WebKit.WKWebView (bundled with OS) | | | QT | qt | WebKit | QtWebEngine / QtWebKit | | | Windows | edgechromium | Chromium | > .NET Framework 4.6.2 and Edge Runtime installed | Ever-green Chromium | -| Windows | edgehtml | EdgeHTML | > .NET Framework 4.6.2 and Windows 10 build 17110 | | | Windows | mshtml | MSHTML | MSHTML via .NET / System.Windows.Forms.WebBrowser | IE11 (Windows 10/8/7) | | Windows | cef | CEF | CEF Python | Chrome 66 | -On Windows renderer is chosen in the following order: `edgechromium`, `edgehtml`, `mshtml`. `mshtml` is the only renderer that is guaranteed to be available on any system. Note that Edge Runtime must be installed in order to use Edge Chromium on Windows. You can download it from [here](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Distribution guidelines are found [here](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution). +On Windows renderer is chosen in the following order: `edgechromium`, `mshtml`. `mshtml` is the only renderer that is guaranteed to be available on any system. Edge Runtime must be installed in order to use Edge Chromium on Windows. You can download it from [here](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Distribution guidelines are found [here](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution). To change a default renderer set either `PYWEBVIEW_GUI` environment variable or pass the rendered value to `webview.start(gui=code)` function parameter. Check for available values in the Code column from the table above. @@ -49,10 +48,6 @@ webview.start(gui='qt') # Known issues and limitations -## GTK WebKit2 - -* Versions of WebKit2 older than 2.2 has a limitation of 1000 characters of the Javascript result returned by `evaluate_js`. `get_elements` is not supported for this reason. - ## QtWebKit * Debugging is not supported diff --git a/webview/__init__.py b/webview/__init__.py index 3fd5201f..323bc81a 100755 --- a/webview/__init__.py +++ b/webview/__init__.py @@ -209,6 +209,7 @@ def create_window( height: int = 600, x: int | None = None, y: int | None = None, + screen: Screen = None, resizable: bool = True, fullscreen: bool = False, min_size: tuple[int, int] = (200, 100), @@ -230,7 +231,6 @@ def create_window( server: type[http.ServerType] = http.BottleServer, http_port: int | None = None, server_args: http.ServerArgs = {}, - screen: Screen = None, ) -> Window: """ Create a web view window using a native GUI. The execution blocks after this function is invoked, so other @@ -239,6 +239,7 @@ def create_window( :param url: URL to load :param width: window width. Default is 800px :param height: window height. Default is 600px + :param screen: Screen to display the window on. :param resizable: True if window can be resized, False otherwise. Default is True :param fullscreen: True if start in fullscreen mode. Default is False :param min_size: a (width, height) tuple that specifies a minimum window size. Default is 200x100 @@ -247,6 +248,7 @@ def create_window( :param easy_drag: Easy window drag mode when window is frameless. :param focus: Whether to activate the window when user opens it. Window can be controlled with mouse but keyboard input will go to another (active) window and not this one. :param minimized: Display window minimized + :param maximized: Display window maximized :param on_top: Keep window above other windows (required OS: Windows) :param confirm_close: Display a window close confirmation dialog. Default is False :param background_color: Background color as a hex string that is displayed before the content of webview is loaded. Default is white. @@ -254,7 +256,6 @@ def create_window( :param transparent: Don't draw window background. :param server: Server class. Defaults to BottleServer :param server_args: Dictionary of arguments to pass through to the server instantiation - :param screen: Screen to display the window upon. :return: window object. """