desktop_webview_window 0.4.0
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
runWebViewTitleBarWidgetstartup hook and the title bar widget;TitleBarWebViewController,TitleBarWebViewState,titleBarHeightandtitleBarTopPaddingare removed. Use the default native title bar, configured withTitleBarOptions, or a native composer. (#518) - Replace the platform-specific JavaScript message APIs with one bridge. Pages call
window.desktopWebview.postMessage(name, data)andwindow.desktopWebview.addEventListener(name, listener); Dart usesaddJavaScriptHandler,removeJavaScriptHandlerandpostMessage.registerJavaScriptMessageHandler,unregisterJavaScriptMessageHandler,postWebMessageAsString,postWebMessageAsJsonandaddOnWebMessageReceivedCallbackare removed, and messages posted towindow.webkit.messageHandlers.<name>orchrome.webvieware 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,bringToForegroundandgetPositionalParameters. UsenativeWindowHandlewith a window library. (#518) - Replace
isNavigatingandsetOnHistoryChangedCallbackwithnavigationState. (#518) - Move the Windows options into
WindowsWebviewOptions: useCreateConfiguration(windows: ...)andclearAll(windows: ...)instead ofuserDataFolderWindowsanddenyCameraAndMicrophone. (#518) evaluateJavaScriptreturns the decoded result asFuture<Object?>instead of a JSON string.launch,close,setBrightness,setOnUrlRequestCallback,addScriptToExecuteOnDocumentCreatedandopenDevToolsWindowreturn futures and report native errors. (#518)- Operations a platform does not support throw
UnsupportedErrorinstead of doing nothing, for examplesetBrightnesson Linux andsetPromptHandleroutside 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.
TitleBarOptionschooses its items per window, and a native composer installed by the runner can replace the layout. (#518) - Add
navigationState, aValueListenablewithcanGoBack,canGoForward,isLoading,urlandtitle. (#518) - Add
onLoadError, which reports top-level pages that fail to load with the URL, aWebviewLoadErrorKind(hostLookup,connection,timeout,certificate,other) and the platform's description. (#534) - Add
nativeWindowHandle, the browser'sHWND,NSWindow*orGtkWindow*, for showing, focusing or moving the window with other libraries. (#518) setOnUrlRequestCallbackcan cancel navigations on every platform, and links to schemes the WebView cannot load, such asmailto:, reach it. (#518)- Show native
alertandconfirmdialogs 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 supportsetBrightnesson Windows. (#518) - Browser IDs are unique per process. (#518)
- macOS:
getAllCookiesreportsexpires,secure,httpOnlyandsessionOnly. (#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 afterflutter cleanneeds access toapi.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
setOnUrlRequestCallbackapproves navigation. (#519; thanks FrankenApps)
0.3.1 #
- Add Windows
openHiddenanddenyCameraAndMicrophoneoptions, 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
runWebViewTitleBarWidgetis 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
titleBarHeightis 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
OnUrlRequestCallbackto return aboolso navigation requests can be allowed or blocked. -
Replace
addOnUrlRequestCallbackandremoveOnUrlRequestCallbackwithsetOnUrlRequestCallback. -
Remove the
onErrorparameter fromrunWebViewTitleBarWidget. -
Add
maximizedparameter tobringToForeground#282 by Iri-Hor -
Add Linux support for
registerJavaScriptMessageHandlerandunregisterJavaScriptMessageHandler#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 #
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
closemethod for WebView. - add
onUrlRequestevent 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 #
- support
isWebviewAvailablecheck. - fix
clearAllcrash 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 #
- implement
addScriptToExecuteOnDocumentCreatedon macOS. - add hot key
command + wto 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.