CustomWebView is an extended, highly customizable WebView component for MIT App Inventor and its distributions (Kodular, Niotron, etc.), designed to provide maximum flexibility, native browser capabilities, and modern Android WebKit features.
Latest Version: 13 Beta
Minimum Android API: 21 (Android 5.0 Lollipop)
Note
Version 13 Architecture: CustomWebView is now split into two modular extension packages:
com.sunny.CustomWebView.aix— Core WebView component and lifecycle manager.com.sunny.cwvutils.aix— Modular companion helpers for content blocking, advanced web features, downloads, and intent handling.
The primary visible/non-visible component replacing standard WebViewer with advanced events, JavaScript interfaces, multi-tab support, and deep lifecycle controls.
A companion bundle containing 4 modular helper components:
AdBlockHelper: Fast, lightweight content blocker powered by AdBlock Plus filter syntax. Attaches directly to CustomWebView viaAttachTo.AdvancedWebHelper: High-level controller for Dark Mode, process-wide Service Workers, and HTTP/HTTPS/SOCKS5 proxy configuration.DownloadHelper: Full-featured download manager using Android's nativeDownloadManagerwith real-time progress callbacks and cancel support.BrowserPromptHelper: Integrates withBrowserActivityto register your app in the Android system browser chooser for external links.
- Dynamic Multi-Tab Management: Create, switch, and cleanly destroy multiple WebView instances on demand without memory leaks.
- JavaScript & DOM Tools: Run asynchronous JavaScript with result callbacks (
EvaluateJs), bind custom JavaScript interfaces, and capture console messages. - Window & Tab Events: Handle
NewWindowRequest,CloseWindowRequest, and popups seamlessly. - Full-Screen Media: Native full-screen HTML5 video support with
OnShowCustomViewandOnHideCustomViewevents. - Page & State Navigation: Forward/backward history traversal, zoom controls, pull-to-refresh, custom user-agent strings, and offline MHTML page saving/loading.
- Interception & Cookies: Modular request interception via
RequestInterceptor, per-URL cookie management, and SSL certificate error handling. - Printing: Built-in document printing integration using Android's
PrintManager. - File Uploads: HTML5 file input support with camera/gallery selectors.
- Scroll & Touch: Custom scroll listeners, programmatic scrolling, and long-click detection.
- High-performance flat filter engine with sub-millisecond rule evaluation.
- Supports cosmetic filtering, domain whitelisting, and rule list parsing.
- Easy integration: Call
AttachTo(CustomWebView)to activate blocking.
- Algorithmic Dark Mode: Enable dark theme across modern Android versions via AndroidX WebKit.
- Proxy Configuration: Route WebView traffic through HTTP, HTTPS, or SOCKS proxies with customizable bypass lists.
- Service Worker Controls: Configure process-wide service worker cache mode, local file access, and network blocking.
- Native
DownloadManagersupport with customized download paths and notification visibility. - Events for
DownloadStarted,DownloadProgressChanged,DownloadCompleted, andDownloadFailed. - File utility helpers (
GuessFileName,GetMimeType,GetFileSize,OpenFile).
- Easily handle incoming browser view intents.
- Route external links directly to your application screens.
You need to ask for permissions only when the corresponding features are used in your application:
| Category | Permissions | Purpose |
|---|---|---|
| Storage & Downloads | android.permission.WRITE_EXTERNAL_STORAGEandroid.permission.ACCESS_DOWNLOAD_MANAGER |
Downloading files to public directories (DownloadHelper). |
| Media & Audio Capture | android.permission.CAMERAandroid.permission.RECORD_AUDIOandroid.permission.MODIFY_AUDIO_SETTINGSandroid.webkit.resource.VIDEO_CAPTUREandroid.webkit.resource.AUDIO_CAPTURE |
WebRTC audio/video calls, camera inputs, and microphone access. |
| Location | android.permission.ACCESS_FINE_LOCATION |
HTML5 Geolocation API requests. |
| Shortcuts & Feedback | android.launcher.permission.INSTALL_SHORTCUTandroid.permission.VIBRATE |
Adding website shortcuts to the home screen and haptic feedback. |
This project builds using Apache Ant:
# Clean previous outputs
ant clean
# Compile and package both extensions
antDo I need to import both AIX files?
CustomWebView.aixcan be used standalone if you only need the browser engine. If you need Ad Blocking, Dark Mode, Proxy override, Download progress, or browser intent filters, importcwvutils.aixalongside it.
How do I enable Ad Blocking in v13?
- Add both
CustomWebViewandAdBlockHelperto your screen.- On screen initialize, call
AdBlockHelper.AttachTo(CustomWebView).
Does the Proxy setting apply to one WebView or all WebViews?
AdvancedWebHelper.SetProxyoperates at the Android process level and routes network requests for all WebViews in the app.
Will disabling
DeepLinkproperty prevent my app from appearing in the browsers list?
No.DeepLinkcontrols whether clicked deep links (liketel:,whatsapp:,mailto:) open external apps. To add your app to the system browser list, useBrowserPromptHelper.
How can I set a screen name as the activity launched from external links?
Simply call theBrowserPromptHelper.RegisterScreen(screenName, startValue)block. It dynamically saves the target screen name and start value, so external links automatically route to your desired screen without editing Java source code or recompiling.
Special thanks to our generous community sponsors: