Skip to content

Conversation

CrisBarreiro
Copy link
Contributor

@CrisBarreiro CrisBarreiro commented Aug 18, 2025

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

Desktop mode

  • Load wikipedia.org
  • Open menu
  • Switch to desktop mode
  • Check desktop mode is loaded

Breakage reporting

  • Load a page
  • Open menu
  • Check subscription with name getBreakageReportValues is sent, and message with method breakageReportResult is received

Disable protections

  • Load http://privacy-test-pages.site/privacy-protections/gpc/
  • Click start test
  • Check:
    • top frame header - "1"
    • top frame JS API - true
    • frame JS API - true
  • Open menu
  • Click Disable Privacy Protection
  • Click start test
  • Check:
    • top frame header - ...
    • top frame JS API - ...
    • frame JS API - ...

Feature enabled

Feature enabled

Feature disabled

Feature enabled

UI changes

No UI changes

Copy link
Contributor Author

CrisBarreiro commented Aug 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch from 5ef0a29 to 9ec7474 Compare August 19, 2025 10:08
@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch from 3614817 to 06fdfe5 Compare August 21, 2025 09:20
@CrisBarreiro CrisBarreiro mentioned this pull request Aug 22, 2025
3 tasks
@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch 8 times, most recently from 6d226d6 to fd8e009 Compare August 29, 2025 10:29
@CrisBarreiro CrisBarreiro marked this pull request as ready for review September 1, 2025 08:05
@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch 6 times, most recently from 943d09f to 28e9d6b Compare September 2, 2025 16:55
@marcosholgado marcosholgado self-assigned this Sep 3, 2025
Copy link
Contributor

@marcosholgado marcosholgado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch 2 times, most recently from 925b63a to 69ff547 Compare September 4, 2025 07:38
@CrisBarreiro CrisBarreiro mentioned this pull request Sep 4, 2025
8 tasks
@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch 2 times, most recently from b45ad03 to 55b4e88 Compare September 4, 2025 12:31
@CrisBarreiro CrisBarreiro force-pushed the cris/adsjs/support-adsjs branch from 55b4e88 to 5dc0e7f Compare September 5, 2025 14:10
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1205008441501016/task/1211092095433618?focus=true

### Description
* 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"


### UI changes
n/a
@marcosholgado marcosholgado merged commit 1088b92 into develop Sep 8, 2025
8 checks passed
@marcosholgado marcosholgado deleted the cris/adsjs/support-adsjs branch September 8, 2025 10:47
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.

2 participants