Skip to content

fix(webview): preserve document-start script order on API 15+ - #85

Draft
LeenHawk wants to merge 1 commit into
harmony-contrib:mainfrom
LeenHawk:fix/ordered-document-start
Draft

LeenHawk wants to merge 1 commit into
harmony-contrib:mainfrom
LeenHawk:fix/ordered-document-start

Conversation

@LeenHawk

@LeenHawk LeenHawk commented Oct 4, 2026

Copy link
Copy Markdown

The legacy javaScriptOnDocumentStart Web attribute executes scripts in lexicographic order. Applications that register framework bootstrap, plugin initialization and application startup in that order can therefore execute application code before its prerequisites.

Use the API-15 runJavaScriptOnDocumentStart Web attribute through an attribute modifier when available. Keep each script as a separate entry so one script's exception does not abort a concatenated bootstrap. Preserve the existing component API on API 12–14 and document its ordering limitation. No Rust/ArkTS bridge contract changes are needed.

Validation: formatted and linted the changed ArkTS file with the repository's oxk tooling; checked the SDK declaration and ordering contract. Device execution and an SDK HAP build remain pending, so this is a draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant