Skip to content

Android initialization ping#2202

Draft
jonathanKingston wants to merge 1 commit intomainfrom
jkt/auto/android-initialization-ping-1cef
Draft

Android initialization ping#2202
jonathanKingston wants to merge 1 commit intomainfrom
jkt/auto/android-initialization-ping-1cef

Conversation

@jonathanKingston
Copy link
Contributor

@jonathanKingston jonathanKingston commented Jan 23, 2026

Asana Task/Github Issue:

Description

Implements an initial ping for the Android bundle, notifying the native app when content scope scripts have been initialized. The initialPing message is sent via Messaging.notify after the init() function completes in injected/entry-points/android.js, but only for top-level frames.

Testing Steps

  • Load a page in the Android app with content scope scripts enabled.
  • Observe the initialPing message being sent from the injected script to the native Android app (requires Android-side logging/instrumentation to verify).

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Open in Cursor Open in Web


Note

Implements a native init notification for Android and adjusts init flow timing.

  • Adds sendInitialPing using Messaging/MessagingContext; skips when isBeingFramed()
  • After load, awaits init(processedConfig) and on success calls messaging.notify('initialPing'); on failure logs in debug and skips ping
  • Updates imports to include messaging utilities; behavior scoped to injected/entry-points/android.js

Written by Cursor Bugbot for commit 5f10541. This will update automatically on new commits. Configure here.

Co-authored-by: jkingston <jkingston@duckduckgo.com>
@cursor
Copy link

cursor bot commented Jan 23, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Jan 23, 2026

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 5f10541
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/6973d8b71ddaae0008900045
😎 Deploy Preview https://deploy-preview-2202--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link
Contributor

[Beta] Generated file diff

Time updated: Fri, 23 Jan 2026 20:24:28 GMT

Android
    - android/brokerProtection.js
  • android/contentScope.js

File has changed

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

if (processedConfig.debug) {
console.error('Android: Initial ping skipped after init failure:', error);
}
}
Copy link

Choose a reason for hiding this comment

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

Initialization errors now silently swallowed in production

Low Severity

The new try-catch block changes error visibility behavior. Previously, init() was called without await, so any errors would surface as unhandled promise rejections visible in the browser console. Now, errors from init() are caught and only logged when processedConfig.debug is true. In production environments where debug is false, init() failures will be completely silent with no console output, potentially making it harder to diagnose issues when initialization fails.


Please tell me if this was useful or not with a 👍 or 👎.

Fix in Cursor Fix in Web

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