advanced_webview 0.11.0
advanced_webview: ^0.11.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.11.0 - 2026-11-12 #
-
Add
AdvancedSystemBrowserandSystemBrowserOptions: open anhttporhttpspage in the system's browser UI, Chrome Custom Tabs on Android andSFSafariViewControlleron iOS, withisAvailable(), atoolbarColoroption and anonClosedcallback. The page runs in the user's browser with its cookies and passkeys, for sign-in flows that should not run in an embedded WebView.onClosedis reliable on iOS and best effort on Android, where Custom Tabs report nothing when they close. The plugin now depends onandroidx.browser. -
Add
AdvancedWebViewController.deleteCookieanddeleteCookies: remove one cookie by name, or every cookie, that the WebView would send to a URL, without clearing the whole store. iOS deletes exactly the cookiesgetCookiesreports; Android cannot see a cookie's domain or path, so it expires it for the host, its parent domains and every path down to the URL's. -
Add
AndroidWebViewSettings.thirdPartyCookiesEnabled(defaultfalse, the platform default) andsafeBrowsingEnabled(defaulttrue, as before; needs Android 8.0 or later). iOS has no equivalent for either. -
Add
AndroidWebViewSettings.algorithmicDarkeningAllowed(defaultfalse) andIOSWebViewSettings.userInterfaceStylewithWebViewUserInterfaceStyle(unspecified,light,dark; defaultunspecified). Android darkens pages that have no dark theme while the app theme is dark (WebSettingsCompat.setAlgorithmicDarkeningAllowed, ignored by WebViews without the feature); iOS fixes the WebView's appearance (overrideUserInterfaceStyle), which decidesprefers-color-scheme. The defaults keep the previous behaviour. -
Add
AdvancedWebViewController.onRenderProcessGone,RenderProcessGoneandRenderProcessGoneCallback: be told when the process that renders web content crashes or is killed. Android now handles the event instead of letting the app terminate (dispose the controller and create a new one); iOS reports it so you can callreload.RenderProcessGone.didCrashisnullon iOS.
0.10.0 - 2026-11-08 #
- Add
AdvancedWebViewController.zoomBy,setZoomScale, andgetZoomScale, and the Android settingsbuiltInZoomControlsanddisplayZoomControls. Android usesWebView.zoomBy; iOS zooms the scroll view and leavesWKWebView.pageZoomtotextZoom. The defaults match the previous behaviour (pinch zoom on, on-screen buttons hidden). - Add
AdvancedWebViewController.pause,resume,pauseTimersandresumeTimers. Android callsWebView.onPause/onResumeand the process-widepauseTimers/resumeTimers; iOS suspends media playback and ignores the timer calls. - Add
AdvancedWebViewController.onClientCertRequest,ClientCertRequestandClientCertResponse: answer a server's client certificate request (mutual TLS) with a PKCS#12 file and password, cancel it, or continue without a certificate.
0.9.0 - 2026-11-06 #
- Add
AdvancedWebViewController.onInterceptRequest,interceptSchemes,InterceptedRequestandInterceptResponse: answer requests to custom URL schemes (and, on Android, any scheme includinghttps) with bytes made up in Dart, or let them through. iOS can only intercept custom schemes because WebKit does not allowhttpandhttps. - Add
AdvancedWebViewController.createPdf: render the current page to PDF bytes. Android paginates on A4 with print styles; iOS returns one page as tall as the content. - Add
AdvancedWebViewController.onFindResultandFindResultCallback: live find progress (active match index, match count, done flag). Android reports every update while WebView counts; iOS reports one final update perfindText. On iOSFindResult.matchCountandactiveMatchIndexare now filled in too, as a best-effort count of the page text. - Add
AdvancedWebViewController.onFaviconChanged: the favicon URL of each page after it loads, read from the page's markup on both platforms (WebKit has no favicon API). - Add
onEnterFullscreenandonExitFullscreen. Android now supports fullscreen video andrequestFullscreen()(it used to ignore them): the plugin covers the Activity window, hides the system bars and exits on back, without changing the orientation. iOS reports WebKit'sfullscreenStateand enables the element fullscreen API.
0.8.0 - 2026-11-05 #
- Add
AdvancedWebViewController.onJsDialog,JsDialogRequest,JsDialogResponseandJsDialogType: answer JavaScriptalert,confirmandpromptdialogs from Dart. Without a callback Android keeps the system WebView's dialog and iOS now shows a native alert (WebKit used to dismiss them silently). - Add
AdvancedWebViewController.clearWebsiteDataandWebsiteDataType: clear the HTTP cache,localStorage/sessionStorageand IndexedDB. Android clears all DOM storage when either storage type is selected. - Add
AdvancedWebViewController.onHttpErrorandHttpError: be told when a server answers with an HTTP status of 400 or more. Android also reports sub-resources; iOS reports the main page and iframes. - Add
AdvancedWebViewController.loadFlutterAsset,loadFileandloadRequest(withWebViewHttpMethod): load a Flutter asset or a local file, and send a POST request with a body. Android needsallowFileAccessforloadFileand cannot add headers to a POST. - Fix Android: permission prompts and the file chooser opened from an
AdvancedInAppBrowsernow appear over the browser instead of behind it.
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.