fluttercommunity / fluttercommunity/flutter_webview_plugin

Can I inject js code before the document loads?

Open
#459 2 comments 6 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.5k
Forks
938
PR merge metrics
No merged PRs in 30d

Description

`evalJavaScript` must be run after the page has finished loading. But i want to inject javascript code before the document loads. Reference:

```swift
WKUserScript(source: sourceJs, injectionTime: .atDocumentStart, forMainFrameOnly: false)
```

so do we provide this flutter api?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the existing evalJavaScript API and the native WebView integration; the issue points to WKUserScript with .atDocumentStart as the requested behavior. Check whether the plugin has a documented entry point or tests for JavaScript injection. Done means establishing whether Flutter can expose injection before document loading, with the behavior verified across the relevant platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
flutter, swift
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.