desktop_webview_window 0.4.0 copy "desktop_webview_window: ^0.4.0" to clipboard
desktop_webview_window: ^0.4.0 copied to clipboard

Show a webview window on your flutter desktop application.

0.4.0 #

Browser windows are now fully native, and one browser API works the same way on macOS, Windows and Linux. See Migrating to 0.4.0.

Breaking changes #

  • Browser windows no longer start a Flutter engine for the title bar. Remove the runWebViewTitleBarWidget startup hook and the title bar widget; TitleBarWebViewController, TitleBarWebViewState, titleBarHeight and titleBarTopPadding are removed. Use the default native title bar, configured with TitleBarOptions, or a native composer. (#518)
  • Replace the platform-specific JavaScript message APIs with one bridge. Pages call window.desktopWebview.postMessage(name, data) and window.desktopWebview.addEventListener(name, listener); Dart uses addJavaScriptHandler, removeJavaScriptHandler and postMessage. registerJavaScriptMessageHandler, unregisterJavaScriptMessageHandler, postWebMessageAsString, postWebMessageAsJson and addOnWebMessageReceivedCallback are removed, and messages posted to window.webkit.messageHandlers.<name> or chrome.webview are no longer forwarded. (#518)
  • JavaScript handlers receive the origin of the sending page: (Object? data, String origin). Check it before a handler acts for a trusted page; messages from iframes are dropped. (#533)
  • Remove moveWebviewWindow, setWebviewWindowVisibility, bringToForeground and getPositionalParameters. Use nativeWindowHandle with a window library. (#518)
  • Replace isNavigating and setOnHistoryChangedCallback with navigationState. (#518)
  • Move the Windows options into WindowsWebviewOptions: use CreateConfiguration(windows: ...) and clearAll(windows: ...) instead of userDataFolderWindows and denyCameraAndMicrophone. (#518)
  • evaluateJavaScript returns the decoded result as Future<Object?> instead of a JSON string. launch, close, setBrightness, setOnUrlRequestCallback, addScriptToExecuteOnDocumentCreated and openDevToolsWindow return futures and report native errors. (#518)
  • Operations a platform does not support throw UnsupportedError instead of doing nothing, for example setBrightness on Linux and setPromptHandler outside macOS. (#518)
  • Linux: Browser windows are independent top-level windows instead of transient children of the application window. (#518)
  • Require Flutter 3.44.0 or later and macOS 10.15 or later. (#518)

Features and fixes #

  • Add a native title bar with back, forward, reload/stop, page title and host on every platform. TitleBarOptions chooses its items per window, and a native composer installed by the runner can replace the layout. (#518)
  • Add navigationState, a ValueListenable with canGoBack, canGoForward, isLoading, url and title. (#518)
  • Add onLoadError, which reports top-level pages that fail to load with the URL, a WebviewLoadErrorKind (hostLookup, connection, timeout, certificate, other) and the platform's description. (#534)
  • Add nativeWindowHandle, the browser's HWND, NSWindow* or GtkWindow*, for showing, focusing or moving the window with other libraries. (#518)
  • setOnUrlRequestCallback can cancel navigations on every platform, and links to schemes the WebView cannot load, such as mailto:, reach it. (#518)
  • Show native alert and confirm dialogs and the system file chooser, ask where to save downloads, and load links that open a new window in the same window, on every platform. (#518)
  • Add CreateConfiguration(brightness:), which applies before the window is shown, and support setBrightness on Windows. (#518)
  • Browser IDs are unique per process. (#518)
  • macOS: getAllCookies reports expires, secure, httpOnly and sessionOnly. (#518)
  • Windows: Support ARM64. The WebView2 SDK is downloaded from NuGet at build time and its loader is linked statically, so applications no longer ship WebView2Loader.dll. The first build after flutter clean needs access to api.nuget.org. (#532)
  • macOS: Remove the deprecated Java applet setting and its build warning. (#531)

0.3.2 #

  • Windows: Preserve the original HTTP method, POST body, and headers when setOnUrlRequestCallback approves navigation. (#519; thanks FrankenApps)

0.3.1 #

  • Add Windows openHidden and denyCameraAndMicrophone options, and fix blank pages when approving navigation requests #508 by mtallenca
  • Prevent stale Windows navigation approvals from replacing newer navigation, restore WebView visibility when maximizing hidden windows, and keep media permission denials out of the shared profile.
  • Update the bundled Windows WebView2 SDK headers, loader DLL, and import library to 1.0.4258.31.
  • Fill the window with web content when runWebViewTitleBarWidget is not called #511 by FrankenApps
  • Fix the macOS Swift Package Manager Flutter framework dependency #510 by FrankenApps
  • Fix a use-after-free when closing a Linux window #513 by matsukiender-star
  • Fix crashes when opening new windows on Linux by opening user-clicked links in the current view and ignoring script-opened windows #514 by matsukiender-star
  • Skip the extra Flutter title-bar engine on Linux when titleBarHeight is zero #515 by matsukiender-star
  • Make Linux WebView windows transient children of the application window #516 by matsukiender-star

0.3.0 #

BREAKING CHANGES

  • Require Dart 3.5 or later.

  • Require macOS 10.13 or later for the macOS plugin.

  • Change OnUrlRequestCallback to return a bool so navigation requests can be allowed or blocked.

  • Replace addOnUrlRequestCallback and removeOnUrlRequestCallback with setOnUrlRequestCallback.

  • Remove the onError parameter from runWebViewTitleBarWidget.

  • Add Swift Package Manager support for macOS #480 by jose3ww

  • Add bringToForeground API #274 by Iri-Hor

  • Add moveWebviewWindow API #280 by Iri-Hor

  • Add maximized parameter to bringToForeground #282 by Iri-Hor

  • Add URL request control support #296 by Iri-Hor

  • Add getPositionalParameters API #291 by Iri-Hor

  • Add getAllCookies API #349 by KRTirtho

  • Add Linux support for registerJavaScriptMessageHandler and unregisterJavaScriptMessageHandler #452 by Carapacik

  • Add backward compatibility with webkit2gtk-4.0 on Linux #311 by prateekmedia

  • Use deprecated WebKitGTK functions only on versions older than 2.40 #334 by prateekmedia

  • Add WebView window safety fixes for Windows and macOS #451 by paulanatoleclaudot-betclic

  • Update README #313 by tanvirulislam

0.2.3 #

  • fix macOS webview window size not working.

0.2.2 #

  • fix memory leak on macOS after close webview window.
  • Show and Hide Webview window by @Iri-Hor in #268

0.2.1 #

  • add Windows attentions to readme.
  • fix linux close sub window cause app exited.
  • fix linux webview title bar expanded unexpected.
  • More control over webview position and size under windows. #206 by Lukas Heinze
  • fix zone mismatch #250 by CD
  • fix linux webkit2gtk deprecated error #246 by Zhiqiang Zhang

0.2.0 #

  • BREAK CHANGE: bump linux webkit2gtk version to 4.1

0.1.6 #

  • fix WebView render area wrong offset on Windows.

0.1.5 #

  • add close method for WebView.
  • add onUrlRequest event for WebView.

0.1.4 #

  • support custom userDataFolder on Windows.
  • fix open web view failed cause crash on Windows.

0.1.3 #

Remove windows addition import requirements.

0.1.2 #

fix TitleBar reload do not work.

0.1.1 #

fix window title not show on macOS

0.1.0 #

support custom titlebar.

NOTE: contains break change. more details see readme.

0.0.7 #

  1. support isWebviewAvailable check.
  2. fix clearAll crash on Linux if no webview created.

0.0.6 #

fix swift definition conflict on macOS. flutter-plugins#17

0.0.5 #

add setApplicationNameForUserAgent for append application name to webview user agent.

0.0.4 #

  1. implement addScriptToExecuteOnDocumentCreated on macOS.
  2. add hot key command + w to close window.

0.0.3 #

fix linux build

0.0.2 #

  • rename project to desktop_webview_window

0.0.1 #

  • add Windows, Linux, macOS support.
222
likes
160
points
605k
downloads

Documentation

API reference

Publisher

verified publishermixin.dev

Weekly Downloads

Show a webview window on your flutter desktop application.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter, path

More

Packages that depend on desktop_webview_window

Packages that implement desktop_webview_window