Skip to content

Commit

Permalink
4.3 info
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Aug 30, 2023
1 parent af9f453 commit 9ac0095
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 15 deletions.
30 changes: 28 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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_
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ actionLink: /guide/
footer: BSD Licensed | Copyright © 2014–present Roman Sirokov
---
<div class='center version'>
Current version: <strong>4.2.2</strong><br/>
Current version: <strong>4.3</strong><br/>
<a href='/changelog'>What's new</a>
</div>

Expand Down
15 changes: 12 additions & 3 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand All @@ -22,14 +22,16 @@ 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
* `hidden` - Create a window hidden by default. Default is False
* `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.
Expand Down Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions docs/guide/renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions webview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand All @@ -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
Expand All @@ -247,14 +248,14 @@ 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.
:param text_select: Allow text selection on page. Default is False.
: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.
"""

Expand Down

0 comments on commit 9ac0095

Please sign in to comment.