Skip to content

Conversation

@CrisBarreiro
Copy link
Contributor

@CrisBarreiro CrisBarreiro commented Oct 30, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1211755269770777?focus=true

Description

Configure script based on remote config

Steps to test this PR

Feature 1

  • Apply patch
  • Clean install app
  • Wait for WebView to load and filter logcat by "Cris"
  • Check there's a log with the script that has been injected, and it contains the following
    • const delay = 10;
    • const postInitialPing = true;
    • const replyToNativeMessages = true;

UI changes

n/a

Copy link
Contributor Author

CrisBarreiro commented Oct 30, 2025

@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch from a52dd72 to d84dffc Compare October 30, 2025 12:01
@CrisBarreiro CrisBarreiro marked this pull request as ready for review October 30, 2025 13:44
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch 2 times, most recently from 301952b to ad6c768 Compare October 30, 2025 14:56
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/create-js-script branch from ac2f5ab to a48fefe Compare October 30, 2025 14:56
private val postInitialPing = "\$POST_INITIAL_PING$"
private val replyToNativeMessages = "\$REPLY_TO_NATIVE_MESSAGES$"

private fun configureWebViewForWebViewCompatTest(webView: DuckDuckGoWebView) {
Copy link
Member

@CDRussell CDRussell Oct 30, 2025

Choose a reason for hiding this comment

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

can we move all of this to its own class to keep BTF changes minimal and contained? thinking there would be a single line in BTF which calls through to your thing passing the WebView for instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I wanted to avoid overengineering for this project, as we did for the previous one, but happy to reach a middle ground between overengineering and purely hacking our way around it

Copy link
Member

@CDRussell CDRussell left a comment

Choose a reason for hiding this comment

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

Approving, but think we should encapsulate that new code to a different class if we can

@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch from ad6c768 to 4939603 Compare November 3, 2025 11:24
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/create-js-script branch from a48fefe to 1078f2d Compare November 3, 2025 11:24
@CrisBarreiro CrisBarreiro mentioned this pull request Nov 3, 2025
35 tasks
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch from 4939603 to 9acf98b Compare November 3, 2025 11:29
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/create-js-script branch from 5a08c8b to e5f0620 Compare November 3, 2025 16:11
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch 4 times, most recently from 2c94455 to 25ece01 Compare November 4, 2025 09:15
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/create-js-script branch from e5f0620 to 31f03cf Compare November 4, 2025 09:15
Comment on lines 50 to 51
withContext(dispatchers.main()) {
val script = withContext(dispatchers.io()) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: i don't think this top level withContext(dispatchers.main()) helps with readability since you immediately jump to another dispatchers in the first of the nested block.

might read better to have val script = withContext(dispatchers.io()) where you get the script on IO, and then withContext(dispatchers.main() for calling addDocumentStartJavaScript. i.e., not nesting the withContext calls.

No strong feelings though.

Copy link
Contributor Author

CrisBarreiro commented Nov 4, 2025

Merge activity

  • Nov 4, 11:09 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 4, 11:12 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 4, 11:36 AM UTC: @CrisBarreiro merged this pull request with Graphite.
@CrisBarreiro CrisBarreiro changed the base branch from feature/cris/derisk-webviewcompat/create-js-script to graphite-base/7036 November 4, 2025 11:10
@CrisBarreiro CrisBarreiro changed the base branch from graphite-base/7036 to develop November 4, 2025 11:10
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch from 5264c26 to 759a26d Compare November 4, 2025 11:11
@CrisBarreiro CrisBarreiro merged commit 1566341 into develop Nov 4, 2025
7 checks passed
@CrisBarreiro CrisBarreiro deleted the feature/cris/derisk-webviewcompat/configure-js-script-based-on-rc-config branch November 4, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants