advanced_webview 0.7.0
advanced_webview: ^0.7.0 copied to clipboard
A simple yet feature-rich Flutter WebView plugin for Android and iOS. One typed Dart API that behaves the same on both platforms.
Changelog #
All notable changes to this project are documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
0.7.0 - 2026-11-05 #
- Add
AdvancedInAppBrowserandInAppBrowserOptions: a full-screen native browser with a toolbar (title or URL, back/forward/reload, close), opened and closed from Dart on Android and iOS, withonOpened,onClosed,onPageStarted,onPageFinishedandonLoadErrorcallbacks andloadUrl/evaluateJavaScriptwhile it is open. - Add a pub.dev badge and install instructions to the READMEs, and a pub.dev link to the docs site navigation.
0.6.0 - 2026-11-05 #
-
Reword the package description and README introductions around the product ("simple yet feature-rich", one typed Dart API with the same behaviour on both platforms) instead of implementation details.
-
Add
AndroidWebViewSettings.geolocationEnabled(defaulttrue, as before), which switchesnavigator.geolocationoff for the page (WebSettings.setGeolocationEnabled). iOS has no equivalent. A location is still only shared when the app holds the location permission andonPermissionRequestgrants it. -
Add
IOSWebViewSettings.allowsLinkPreview(defaulttrue, as before), which turns off the link preview shown when the user presses and holds a link (WKWebView.allowsLinkPreview). Android has no equivalent. -
Add
IOSWebViewSettings.contentModeandWebViewContentMode(recommended,mobile,desktop), which choose the mobile or desktop version of sites on iOS (WKWebpagePreferences.preferredContentMode). It takes effect on the next navigation. Android has no equivalent. -
Add
IOSWebViewSettings.applicationNameForUserAgent(creation only), which appends a token such asMyApp/1.0to the default iOS user agent (WKWebViewConfiguration.applicationNameForUserAgent) without replacing it. Android has no equivalent; useWebViewSettings.userAgentthere. -
Align the English and Japanese README introductions and package description with the GitHub repository description.
-
Move the design rationale to
ARCHITECTURE.md, refresh its guidance, and point package documentation to the published guide site.
0.5.0 - 2026-11-02 #
-
Add
AdvancedWebViewController.onConsoleMessage, which reports the page'sconsole.debug,log,info,warnanderrorcalls asWebViewConsoleMessage(level, text, and on Android the source URL and line number). Android usesWebChromeClient.onConsoleMessage; iOS wraps theconsolemethods with a user script injected into every frame, so the source location isnullthere. -
Breaking: platform-specific settings moved out of
WebViewSettingsinto two new classes, passed asWebViewSettings.androidandWebViewSettings.ios. The other platform ignores them. Defaults are unchanged.AndroidWebViewSettings:supportZoom,passkeysEnabled,domStorageEnabled,allowFileAccess,allowContentAccess,mixedContentMode.IOSWebViewSettings:allowsInlineMediaPlayback,allowsBackForwardNavigationGestures,incognito.
Before:
WebViewSettings(passkeysEnabled: true, incognito: true). After:WebViewSettings(android: AndroidWebViewSettings(passkeysEnabled: true), ios: IOSWebViewSettings(incognito: true)).
0.4.0 - 2026-11-02 #
-
Add the Android settings
WebViewSettings.domStorageEnabled(defaulttrue, as before),allowFileAccess,allowContentAccessandmixedContentMode(WebViewMixedContentMode). iOS ignores them. Behaviour change:allowFileAccessandallowContentAccessnow default tofalse(previously the WebView defaults applied:content://access was on, andfile://access depended on the app's target SDK), and mixed content is explicitly blocked. Set them totrueto restore the old behaviour. -
Add
AdvancedWebViewController.onLongPress(touch position in logical pixels) andhitTest, which reports the link and/or image under a point (WebViewHitTestResult). Together they let apps build a custom context menu.hitTestusesdocument.elementFromPoint, so it is main-frame only and identical on both platforms; the platform's own long-press behaviour is not suppressed. -
Add
AdvancedWebViewController.printPage, which opens the system print dialog for the current page (PrintManageron Android,UIPrintInteractionControlleron iOS). -
Add
AdvancedWebViewController.saveStateandrestoreState, which snapshot and restore the back/forward history and scroll position as opaque bytes (WebView.saveStateon Android,WKWebView.interactionStateon iOS). Snapshots only work on the platform that created them. -
Add scrolling:
AdvancedWebViewController.scrollTo,scrollBy,scrollPositionand theonScrollChangedcallback. Offsets are logical pixels on both platforms (WebView.scrollTo/setOnScrollChangeListeneron Android,UIScrollView.contentOffseton iOS).
0.3.0 - 2026-11-02 #
-
Add
WebViewSettings.pullToRefreshEnabled: pulling down from the top reloads the page with the platform's refresh indicator (SwipeRefreshLayouton Android,UIRefreshControlon iOS). On Android the platform view is now aSwipeRefreshLayoutthat contains the WebView. -
Add find-in-page:
AdvancedWebViewController.findText(returns aFindResult) andclearMatches. Android usesWebView.findAllAsync/findNext; iOS usesWKWebView.findand reports only whether a match was found (no count). -
Add
AdvancedWebViewController.takeScreenshot, which returns a PNG of the visible area (WebView.drawon Android,WKWebView.takeSnapshoton iOS). -
Add
WebViewSettings.incognito(iOS only, creation only): the WebView usesWKWebsiteDataStore.nonPersistent(). Ignored on Android, whose WebView shares data across the app. -
Add
WebViewSettings.javaScriptCanOpenWindowsAutomatically(defaulttrue, as before),scrollbarsVisibleandoverScrollEnabled. -
Add
WebViewSettings.cacheModeandWebViewCacheMode. Android setsWebSettings.setCacheModefor every load; iOS applies the cache policy to requests started withloadUrl. -
Add
WebViewSettings.textZoom(percent; Android scales text only, iOS scales the page withWKWebView.pageZoom) andWebViewSettings.minimumFontSize. -
Add
WebViewSettings.allowsBackForwardNavigationGestures(iOS only, swipe to go back/forward) andWebViewSettings.inspectable(Safari Web Inspector on iOS;WebView.setWebContentsDebuggingEnabledon Android, which is process-wide).
0.2.0 - 2026-11-01 #
-
Add
AdvancedWebViewController.onSslErrorandonHttpAuthRequest(SslError,SslErrorDecision,HttpAuthRequest,HttpAuthCredentials). Certificate errors are still refused unless the callback returnsproceed; HTTP authentication is cancelled unless the callback returns credentials. -
Add
AdvancedWebViewController.onDownloadStartandDownloadRequest: the WebView reports downloads (attachments, files it cannot show,downloadlinks) instead of saving them, so the app decides how to fetch the file. Android usesWebView.setDownloadListener; iOS cancels theWKNavigationResponse/WKNavigationActionand reports it. -
Add
AdvancedWebViewController.onPermissionRequestto decide whether a page may use the camera, microphone or location (PermissionRequest,PermissionResource,PermissionDecision). Without a callback every request is denied. On Android the plugin also asks for the runtime permission after you grant; geolocation is Android only because WebKit has no delegate for it. -
Add JavaScript handlers with return values: the
javaScriptHandlersconstructor parameter andwindow.advanced_webview.callHandler(name, ...args), which returns a promise settled with the Dart handler's result (or rejected when it throws). The global iswindow.advanced_webviewby default;javaScriptHandlerObjectNamerenames it. Android needsWEB_MESSAGE_LISTENER.
0.1.0 - 2026-10-31 #
First release on pub.dev.
- Raise the minimum Flutter SDK to 3.47.8 (Dart 3.13.7), the version the plugin is built and tested with.
- Android: disabling
passkeysEnablednow resets WebAuthn support after it was enabled. - iOS:
getCookiesmatches cookie paths at slash boundaries instead of arbitrary prefixes. - Clarify navigation and JavaScript channel trust boundaries in English and Japanese, and document app setup requirements.
- Add
WebViewSettings.passkeysEnabledto enable WebAuthn / passkeys on Android (WebSettingsCompat.setWebAuthenticationSupport). iOS needs no setting; the app must have the Associated Domainswebcredentialsentitlement. - Android:
<input type="file">now opens the system file picker (it did nothing before). iOS already used WebKit's built-in picker. - Add
AdvancedWebViewController.onNewWindowforwindow.openandtarget="_blank". Without it, the URL now loads in the same WebView on both platforms (previously nothing happened on iOS). - CI: lock GitHub Actions dependencies with
gh actions-lock(.github/workflows/actions.lockpins every action, including transitive ones, to a commit SHA), verify it in the newverify-lockfileworkflow, and reference actions by exact release tag. - Add user scripts:
UserScript, theuserScriptsconstructor parameter, andAdvancedWebViewController.addUserScript/removeAllUserScripts. Android usesandroidx.webkit(DOCUMENT_START_SCRIPT). - Add cookie management:
AdvancedWebViewController.setCookie,getCookiesandclearCookieswith theWebViewCookietype. On AndroidgetCookiesonly reports name and value. - Docs site: pin npm dependencies to exact versions and harden installs against supply-chain
attacks (
website/.npmrc,website/bunfig.toml: no lifecycle scripts, 7-day minimum release age, frozen lockfile, Dependabot cooldown). - Rename the package from
flutter_mobile_webviewtoadvanced_webview(Dart package, entry librarypackage:advanced_webview/advanced_webview.dart, Android package/namespace, iOS module and Pigeon channel names) and the public classes fromMobileWebView/MobileWebViewControllertoAdvancedWebView/AdvancedWebViewController. - iOS: raise the minimum iOS version to 18.0.
- iOS: run
evaluateJavaScripton the main thread; it could hang when called off it. - Make
README.mdEnglish and move the Japanese README toREADME.ja.md. - Add MIT license, community health files, issue/PR templates and pub.dev metadata.
- Pin Flutter 3.47.8 with mise (
mise.toml); CI uses the same version. - Android: detach the WebView from its previous container when a controller is shown
by a new
AdvancedWebView, so re-attaching a controller does not fail. - iOS: app-initiated loads (
loadUrl,loadHtmlString,reload,goBack,goForward) no longer reachonNavigationRequest, matching Android. - Add native unit tests (Robolectric on Android, XCTest on iOS) and run the integration tests on an Android emulator and an iOS simulator in CI.
- Lint and format native code in CI: ktlint for Kotlin and swift-format for Swift (Pigeon-generated files are excluded).
- iOS: support both Swift Package Manager and CocoaPods, and ship a privacy manifest
(
PrivacyInfo.xcprivacy) with either. CI builds the example app with each. - Add AI agent configuration (
AGENTS.md, APM with shared skills fromimk1t/apm-shared).
0.0.1 #
- Initial scaffold: Pigeon-based platform contract, Android (Kotlin) and iOS (Swift) implementations, and an example app.