Skip to content

Commit 722d45c

Browse files
jonathanKingstonCrisBarreirodependabot[bot]noisysocksclaude
authored
adsjs messaging (#1883)
* Initial Android adsjs bundle * Rename output script to something more sensible * Add inject name * lint fix * PoC messaging adsjs * Removal of ports argument * Change up wrapping * Fix up typing * Enable share on iframes and fix support issues * Revert "Enable share on iframes and fix support issues" This reverts commit 51f7413. * Inject name conditional (#1884) * Add enum devices debugging * Disable device enumeration remotely * Fix lint * Add frame flexibility * Move to webCompat * Conditional frame matching * Test case * Frame test changes, still not working * Fix up frame testing * Simplify test checks * Remove bundle for debugging * Add injectName conditional matching * Improve comment * build(deps): bump immutable-json-patch from 6.0.1 to 6.0.2 (#1873) * build(deps): bump immutable-json-patch from 6.0.1 to 6.0.2 Bumps [immutable-json-patch](https://github.com/josdejong/immutable-json-patch) from 6.0.1 to 6.0.2. - [Changelog](https://github.com/josdejong/immutable-json-patch/blob/main/CHANGELOG.md) - [Commits](https://github.com/josdejong/immutable-json-patch/commits) --- updated-dependencies: - dependency-name: immutable-json-patch dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Fix replace state tests * Add failure case if the library behaviour is now reverted --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonathan Kingston <[email protected]> * build(deps-dev): bump eslint from 9.32.0 to 9.33.0 in the eslint group (#1886) Bumps the eslint group with 1 update: [eslint](https://github.com/eslint/eslint). Updates `eslint` from 9.32.0 to 9.33.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v9.32.0...v9.33.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.33.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump @rive-app/canvas-single from 2.30.4 to 2.31.1 (#1885) Bumps [@rive-app/canvas-single](https://github.com/rive-app/rive-wasm) from 2.30.4 to 2.31.1. - [Changelog](https://github.com/rive-app/rive-wasm/blob/master/CHANGELOG.md) - [Commits](rive-app/rive-wasm@2.30.4...2.31.1) --- updated-dependencies: - dependency-name: "@rive-app/canvas-single" dependency-version: 2.31.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix context menu by filtering fake widgets starting with underscore (#1888) The context menu was including fake widgets (like _omnibar-toggleAi for Duck.ai toggle) which caused issues with native app integration. This change: - Updates useContextMenu() to filter out all widgets with IDs starting with '_' - Renames debug widget ID from 'debug' to '_debug' for consistency - Adds integration test to verify only real widgets appear in context menu 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]> * NTP: Omnibar design fixes i2 (#1889) * Remove focusRing state and update popup focus styles: - Show rest state by defualt - Show focus state only when input/textarea is selected and empty - Show suggestions state only when suggestions list is open * Make close button clear input and hide suggestions in one click * Adjust padding around X button in SearchForm * Refocus input after clearing search term * Fix spacer height to accommodate largest tab without animation * Use --ntp-surface-tertiary (with correct value from Figma) when using default background and --ntp-surface-background-color when using a custom background * Use dark mode icons in TabSwitcher * Adjust omnibar and tab switcher background when using a custom background * Update ntp-controls-raised-backdrop color variables * Update SearchColorIcon and AiChatColorIcon SVG gradients and colors * feat: Add Duck.ai icon for RMF, update a couple other RMF icons (#1892) * feat: Add Duck.ai icon for RMF, update a couple other icons * fix: example * rm: overflow2 example * Replace newlines with spaces when switching from Duck.ai to Search tab. (#1894) This matches how SERP behaves * NTP: Refine omnibar background, outline, and elevation styles (#1893) * Refine popup background, outline, and elevation styles * Update CloseSmallIcon * Fix lint warnings (#1890) * Refactor variable names and improve type safety in customizer and build scripts Co-authored-by: randerson <[email protected]> * Don't typecast to any --------- Co-authored-by: Cursor Agent <[email protected]> * Force search mode when Duck.ai is disabled in Omnibar (#1895) * build(deps): bump @rive-app/canvas-single from 2.31.1 to 2.31.2 (#1902) Bumps [@rive-app/canvas-single](https://github.com/rive-app/rive-wasm) from 2.31.1 to 2.31.2. - [Changelog](https://github.com/rive-app/rive-wasm/blob/master/CHANGELOG.md) - [Commits](rive-app/rive-wasm@2.31.1...2.31.2) --- updated-dependencies: - dependency-name: "@rive-app/canvas-single" dependency-version: 2.31.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump esbuild from 0.25.8 to 0.25.9 (#1903) Bumps [esbuild](https://github.com/evanw/esbuild) from 0.25.8 to 0.25.9. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](evanw/esbuild@v0.25.8...v0.25.9) --- updated-dependencies: - dependency-name: esbuild dependency-version: 0.25.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump actions/checkout from 4 to 5 (#1901) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add initial ping message * Fix tests * Remove frame limitation * Add breakageReporting to bundle * Add apiManipulation to the new bundle --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Cris Barreiro <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Robert Anderson <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Valerie Kraucunas <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
1 parent 6304c5b commit 722d45c

File tree

9 files changed

+420
-6
lines changed

9 files changed

+420
-6
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @module Android AdsJS integration
3+
*/
4+
import { load, init } from '../src/content-scope-features.js';
5+
import { processConfig } from './../src/utils';
6+
import { AndroidAdsjsMessagingConfig } from '../../messaging/index.js';
7+
8+
function initCode() {
9+
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
10+
const config = $CONTENT_SCOPE$;
11+
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
12+
const userUnprotectedDomains = $USER_UNPROTECTED_DOMAINS$;
13+
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
14+
const userPreferences = $USER_PREFERENCES$;
15+
16+
const processedConfig = processConfig(config, userUnprotectedDomains, userPreferences);
17+
18+
const configConstruct = processedConfig;
19+
const objectName = configConstruct.objectName || 'contentScopeAdsjs';
20+
21+
processedConfig.messagingConfig = new AndroidAdsjsMessagingConfig({
22+
objectName,
23+
target: globalThis,
24+
debug: processedConfig.debug,
25+
});
26+
27+
load({
28+
platform: processedConfig.platform,
29+
site: processedConfig.site,
30+
bundledConfig: processedConfig.bundledConfig,
31+
messagingConfig: processedConfig.messagingConfig,
32+
messageSecret: processedConfig.messageSecret,
33+
});
34+
35+
init(processedConfig);
36+
}
37+
38+
initCode();

injected/scripts/entry-points.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const builds = {
3535
input: 'entry-points/android.js',
3636
output: ['../build/android/autofillPasswordImport.js'],
3737
},
38+
'android-adsjs': {
39+
input: 'entry-points/android-adsjs.js',
40+
output: ['../build/android/adsjsContentScope.js'],
41+
},
3842
windows: {
3943
input: 'entry-points/windows.js',
4044
output: ['../build/windows/contentScope.js'],

injected/src/features.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ export const platformSupport = {
4949
android: [...baseFeatures, 'webCompat', 'breakageReporting', 'duckPlayer', 'messageBridge'],
5050
'android-broker-protection': ['brokerProtection'],
5151
'android-autofill-password-import': ['autofillPasswordImport'],
52+
'android-adsjs': [
53+
'apiManipulation',
54+
'webCompat',
55+
'fingerprintingHardware',
56+
'fingerprintingScreenSize',
57+
'fingerprintingTemporaryStorage',
58+
'fingerprintingAudio',
59+
'fingerprintingBattery',
60+
'gpc',
61+
'breakageReporting',
62+
],
5263
windows: [
5364
'cookie',
5465
...baseFeatures,

injected/src/features/web-compat.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ function canShare(data) {
4646
return false;
4747
}
4848
}
49-
if (window !== window.top) return false; // Not supported in iframes
5049
return true;
5150
}
5251

injected/src/globals.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ interface ImportMeta {
2020
| 'integration'
2121
| 'chrome-mv3'
2222
| 'android-broker-protection'
23-
| 'android-autofill-password-import';
23+
| 'android-autofill-password-import'
24+
| 'android-adsjs';
2425
trackerLookup?: Record<string, unknown>;
2526
pageName?: string;
2627
}

injected/unit-test/verify-artifacts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const ROOT = join(cwd(import.meta.url), '..', '..');
77
console.log(ROOT);
88
const BUILD = join(ROOT, 'build');
99

10-
let CSS_OUTPUT_SIZE = 770_000;
10+
let CSS_OUTPUT_SIZE = 780_000;
1111
if (process.platform === 'win32') {
1212
CSS_OUTPUT_SIZE = CSS_OUTPUT_SIZE * 1.1; // 10% larger for Windows due to line endings
1313
}

messaging/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
import { WebkitMessagingConfig, WebkitMessagingTransport } from './lib/webkit.js';
3131
import { NotificationMessage, RequestMessage, Subscription, MessageResponse, MessageError, SubscriptionEvent } from './schema.js';
3232
import { AndroidMessagingConfig, AndroidMessagingTransport } from './lib/android.js';
33+
import { AndroidAdsjsMessagingConfig, AndroidAdsjsMessagingTransport } from './lib/android-adsjs.js';
3334
import { createTypedMessages } from './lib/typed-messages.js';
3435

3536
/**
@@ -51,7 +52,7 @@ export class MessagingContext {
5152
}
5253

5354
/**
54-
* @typedef {WebkitMessagingConfig | WindowsMessagingConfig | AndroidMessagingConfig | TestTransportConfig} MessagingConfig
55+
* @typedef {WebkitMessagingConfig | WindowsMessagingConfig | AndroidMessagingConfig | AndroidAdsjsMessagingConfig | TestTransportConfig} MessagingConfig
5556
*/
5657

5758
/**
@@ -215,7 +216,7 @@ export class TestTransport {
215216
}
216217

217218
/**
218-
* @param {WebkitMessagingConfig | WindowsMessagingConfig | AndroidMessagingConfig | TestTransportConfig} config
219+
* @param {WebkitMessagingConfig | WindowsMessagingConfig | AndroidMessagingConfig | AndroidAdsjsMessagingConfig | TestTransportConfig} config
219220
* @param {MessagingContext} messagingContext
220221
* @returns {MessagingTransport}
221222
*/
@@ -229,6 +230,9 @@ function getTransport(config, messagingContext) {
229230
if (config instanceof AndroidMessagingConfig) {
230231
return new AndroidMessagingTransport(config, messagingContext);
231232
}
233+
if (config instanceof AndroidAdsjsMessagingConfig) {
234+
return new AndroidAdsjsMessagingTransport(config, messagingContext);
235+
}
232236
if (config instanceof TestTransportConfig) {
233237
return new TestTransport(config, messagingContext);
234238
}
@@ -268,5 +272,7 @@ export {
268272
WindowsRequestMessage,
269273
AndroidMessagingConfig,
270274
AndroidMessagingTransport,
275+
AndroidAdsjsMessagingConfig,
276+
AndroidAdsjsMessagingTransport,
271277
createTypedMessages,
272278
};

0 commit comments

Comments
 (0)