From 1442c871e0df2bddb70d63eff9b9f78b1a0e55ed Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Wed, 25 Sep 2024 08:45:00 +0100 Subject: [PATCH] docs --- build/app/public/js/base.js | 5 ++++- guides/toggle-report.js | 9 +++++++-- shared/js/browser/android-communication.js | 5 ++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/build/app/public/js/base.js b/build/app/public/js/base.js index a720375e..e5b30dd2 100644 --- a/build/app/public/js/base.js +++ b/build/app/public/js/base.js @@ -14392,7 +14392,6 @@ /** * {@inheritDoc common.openInNewTab} * @type {import("./common.js").openInNewTab} - * * ```js * const payload = JSON.stringify({ * "url": "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/" @@ -14443,6 +14442,10 @@ /** * {@inheritDoc common.sendToggleReport} * @type {import("./common.js").sendToggleReport} + * @example + * ```js + * window.PrivacyDashboard.sendToggleReport() + * ``` */ sendToggleReport() { invariant(window.PrivacyDashboard?.sendToggleReport, "sendToggleReport missing"); diff --git a/guides/toggle-report.js b/guides/toggle-report.js index 5da4d840..598bc37d 100644 --- a/guides/toggle-report.js +++ b/guides/toggle-report.js @@ -30,18 +30,23 @@ * * * - WebKit: {@link "macOS integration".privacyDashboardGetToggleReportOptions} - * - Other platforms will be added + * - Android: {@link "Android integration".PrivacyDashboardJavascriptInterface.getToggleReportOptions} * * ## Step 4: Implement new handlers * * The following are all sent in response to user interactions * - * ### 👆Sending/rejecting the report + * ### 👆Sending the report * - WebKit: {@link "macOS integration".privacyDashboardSendToggleReport} + * - Android: {@link "Android integration".PrivacyDashboardJavascriptInterface.sendToggleReport} + * + * ### 👆Rejecting the report * - WebKit: {@link "macOS integration".privacyDashboardRejectToggleReport} + * - Android: {@link "Android integration".PrivacyDashboardJavascriptInterface.rejectToggleReport} * * ### 👆Tapping the 'see what's sent' list * - Webkit: {@link "macOS integration".privacyDashboardSeeWhatIsSent} + * - Android: {@link "Android integration".PrivacyDashboardJavascriptInterface.seeWhatIsSent} * * ### 👆Tapping anywhere on the success screen (macos only) * - Webkit: {@link "macOS integration".privacyDashboardClose} diff --git a/shared/js/browser/android-communication.js b/shared/js/browser/android-communication.js index 0ade3c6e..e2e41f55 100644 --- a/shared/js/browser/android-communication.js +++ b/shared/js/browser/android-communication.js @@ -292,7 +292,6 @@ export class PrivacyDashboardJavascriptInterface { /** * {@inheritDoc common.openInNewTab} * @type {import("./common.js").openInNewTab} - * * ```js * const payload = JSON.stringify({ * "url": "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/" @@ -347,6 +346,10 @@ export class PrivacyDashboardJavascriptInterface { /** * {@inheritDoc common.sendToggleReport} * @type {import("./common.js").sendToggleReport} + * @example + * ```js + * window.PrivacyDashboard.sendToggleReport() + * ``` */ sendToggleReport() { invariant(window.PrivacyDashboard?.sendToggleReport, 'sendToggleReport missing')