Skip to content

feat: improved webview - #2924

Draft
RohitKushvaha01 wants to merge 2 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:improved_webview
Draft

RohitKushvaha01 wants to merge 2 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:improved_webview

Conversation

@RohitKushvaha01

Copy link
Copy Markdown
Member

Closes #2772

@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no new actionable defects remain after the latest fixes.

Summary

This PR substantially expands the Cordova WebView integration with configurable settings, lifecycle and navigation events, profile-based isolation, fullscreen media support, download handling, richer state access, and TypeScript declarations.

  • Adds named and ephemeral AndroidX WebKit profiles with canonical-name validation and cleanup.
  • Adds runtime WebView configuration, history controls, state snapshots, capability detection, and registry helpers.
  • Extends the JavaScript/native bridge with richer events, messaging, permissions, errors, downloads, and fullscreen behavior.
  • The changes since the previous review address UI-thread settings access, early isolation metadata, profile-name collisions, and profile-scoped download cookies.

Diagram

sequenceDiagram
    participant Plugin as Plugin caller
    participant JS as Acode WebView API
    participant Cordova as Cordova bridge
    participant Native as WebViewPlugin
    participant Profile as ProfileManager
    participant View as WebViewInstance

    Plugin->>JS: create(options)
    JS->>JS: Validate and normalize options
    JS->>Cordova: create(options)
    Cordova->>Native: create
    Native->>Profile: Acquire named/ephemeral profile
    Profile-->>Native: Profile and isolation status
    Native->>View: Construct instance
    Native-->>JS: id, options, capabilities, isolation metadata
    JS-->>Plugin: AcodeWebView

    Plugin->>JS: load/configure/show
    JS->>Cordova: Native action
    Cordova->>View: Execute on UI thread
    View-->>JS: Result or asynchronous event
    JS-->>Plugin: Updated state/event
Loading

Reviews (2) · Last reviewed commit: "feat(webview): incognito profiles, confi..."

Comment thread src/plugins/webview/src/android/com/foxdebug/webview/WebViewInstance.java Outdated
Comment thread src/plugins/webview/src/android/com/foxdebug/webview/ProfileManager.java Outdated
@greptile-apps

This comment has been minimized.

@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptile

@RohitKushvaha01 RohitKushvaha01 moved this from Backlog to In progress in The Code Board - Acode Sep 22, 2026
…vents

Rework the Acode WebView API end to end.

- Incognito mode backed by AndroidX WebKit multi-profile isolation, with
  reference-counted profiles, automatic cleanup and a documented best-effort
  fallback when the provider lacks multi-profile support.
- Configurable user agent (explicit string or desktop/mobile presets) and a
  broad set of WebSettings, applied at creation and at runtime on the UI
  thread.
- Expanded event stream (page lifecycle, progress, navigation, errors,
  console, dialogs, permissions, fullscreen, downloads, scroll) plus
  navigation/settings helpers, capability probes and registry utilities.
- Split the native plugin into WebViewPlugin/WebViewInstance/WebViewOptions/
  ProfileManager and the JS into a thin bridge plus a public AcodeWebView API.
- Harden profile names (reject non-canonical or reserved names instead of
  rewriting them) and use the originating profile's cookie jar for downloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Improve Webview API

1 participant