You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for addDocumentStartJavaScript (#6600)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1205008441501016/task/1211044367033330?focus=true
### Description
* Add support for injecting a subset of C-S-S features using
`addDocumentStartJavaScript`, keeping support for `activeExperiments`
compatible with both `addDocumentStartJavaScript` and
`evaluateJavaScript`
* C-S-S sends us a ping message so we have a reference to a reply proxy
that we store and use to send messages after a user action is initiated
on the native side
* Process messages by context, then feature, and then method
* Refactor message posting fallback mechanism
* Make scoping/instancing explicit
### Steps to test this PR
**Pre-requisites**
- [x] Install C-S-S 11.15.0
- [x] Load privacy-config from
https://duckduckgo.github.io/privacy-configuration/pr-3624/v4/android-config.json
- [x] Set version to 5.300.1 in version.properties
- [x] Add logs to
`WebViewCompatBreakageContentScopeJsMessageHandler#process` and
`WebViewCompatWebCompatMessagingPlugin#postMessage`
- [x] Enable `useNewWebCompatApis` under feature flag inventory (enabled
by default)
_Desktop mode_
- [x] Load wikipedia.org
- [x] Open menu
- [x] Switch to desktop mode
- [x] Check desktop mode is loaded
_Breakage reporting_
- [x] Load a page
- [x] Open menu
- [x] Check subscription with name `getBreakageReportValues` is sent,
and message with method `breakageReportResult` is received
_Disable protections_
- [x] Load http://privacy-test-pages.site/privacy-protections/gpc/
- [x] Click start test
- [x] Check:
- [x] `top frame header - "1"`
- [x] `top frame JS API - true`
- [x] `frame JS API - true`
- [x] Open menu
- [x] Click Disable Privacy Protection
- [x] Click start test
- [x] Check:
- [x] `top frame header - ...`
- [x] `top frame JS API - ...`
- [x] `frame JS API - ...`
_Feature enabled_
- [x] Enable `useNewWebCompatApis` under feature flag inventory (enabled
by default)
- [x] Open https://w3c.github.io/web-share/demos/share-files.html
- [x] Click "Share"
- [x] Dismiss native share popup
- [x] Check message displayed: "Error sharing: Abort Error: Share
canceled"
_Feature enabled_
- [x] Enable `useNewWebCompatApis` under feature flag inventory (enabled
by default)
- [x] Open http://privacy-test-pages.site/privacy-protections/gpc/
- [x] Click on "Start test"
- [x] Check `frame JS API - true`
_Feature disabled_
- [x] Disable `useNewWebCompatApis` under feature flag inventory
(enabled by default)
- [x] Open http://privacy-test-pages.site/privacy-protections/gpc/
- [x] Click on "Start test"
- [x] Check `frame JS API - ...`
_Feature enabled_
- [x] Enable `useNewWebCompatApis` under feature flag inventory (enabled
by default)
- [x] Open http://privacy-test-pages.site/privacy-protections/gpc/
- [x] Check logs for `DebugFlagGlobalHandler addDebugFlag:
fingerprintingScreenSize`
### UI changes
No UI changes
0 commit comments