Add New Tab rebrand feature flag wiring - #2844
Conversation
[Beta] Generated file diffTime updated: Mon, 20 Jul 2026 01:34:54 GMT Apple
File has changed Integration
File has changed Windows
File has changed |
|
This PR requires a manual review and approval from a member of one of the following teams:
|
80008eb to
9a506ab
Compare
Build Branch
Static preview entry points
QR codes (mobile preview)
Integration commandsnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/matteo/rebrand/new-tab-page-feature-flag")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/matteo/rebrand/new-tab-page-feature-flag
git -C submodules/content-scope-scripts checkout origin/pr-releases/matteo/rebrand/new-tab-page-feature-flagPin to exact commitnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "d80c6c0cd76c63814f596cf6ffdf3d618cb47f4b")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/matteo/rebrand/new-tab-page-feature-flag
git -C submodules/content-scope-scripts checkout d80c6c0cd76c63814f596cf6ffdf3d618cb47f4b |
bddc078 to
2440ca0
Compare
There was a problem hiding this comment.
Stale comment
Web Compatibility Assessment
No injected (
injected/) or page-world API changes in this PR. All changes are confined to the special-pages New Tab app (settings wiring, adata-rebrandbody attribute, an empty CSS placeholder, mock transport, and integration tests). From a web-compatibility perspective for third-party sites, this PR is a no-op — it does not run on arbitrary web pages.
File Lines Severity Finding special-pages/pages/new-tab/app/index.js179 info data-rebrandfollows the sameinstallGlobalSideEffectspattern as existingdata-platform-name/data-display/data-animationattributes.document.bodyis available afterinitialSetup()resolves. Default is"false".special-pages/pages/new-tab/app/components/App.module.css30–32 info Empty body[data-rebrand="true"]rule block has no layout or rendering impact today. Future styles added here should be tested across platforms (iOS/Android WebView quirks, reduced motion, theme variants).special-pages/pages/new-tab/app/settings.provider.js42–45 info useNtpRebrand()is exported but not yet consumed by components. Safe scaffolding; no runtime side effects until future PRs use it.special-pages/pages/new-tab/app/settings.js21, 49–61 info Default ntpRebrand: { state: 'disabled' }andwithFeatureStateenum validation mirroradBlocking. Invalid or missing native values safely fall back to disabled.No warnings or errors for web compatibility.
Security Assessment
No changes to messaging transports, message bridge,
captured-globals, API overrides, or injected initialization. Security surface is limited to native→NTP settings delivery (existing trust boundary).
File Lines Severity Finding special-pages/pages/new-tab/messages/types/settings.json30–38 info ntpRebrand.staterestricted to"enabled"/"disabled"enum — consistent withadBlocking.special-pages/pages/new-tab/app/mock-transport.js617–619 info ?rebrand=enabledURL param only affects local dev / Playwright mock transport, not production native builds.special-pages/pages/new-tab/app/index.js179 info data-rebrandis a non-sensitive UI flag exposed on<body>. Same exposure model as otherdata-*attributes already set by NTP. NonativeDataforwarding.No warnings, errors, or critical findings for security.
Risk Level
Low Risk — Special-pages-only feature-flag scaffolding with safe defaults, schema validation, and integration test coverage; zero injected or messaging security surface changes.
Recommendations
- (info) When rebrand CSS is populated in follow-up PRs, run visual QA across theme variants (
themeVariantparam), light/dark, and reduced-motion — the empty placeholder is harmless now but future rules could affect layout.- (info) Consider documenting
?rebrand=enabledinspecial-pages/pages/new-tab/readme.mdalongside other feature URL params for local dev consistency (optional; other settings flags like ad-blocking are also undocumented).- (info) Verify native clients send
ntpRebrandininitialSetup.settingsbefore enabling the flag in production — C-S-S defaults to disabled when absent, which is the correct safe fallback.Integration tests for the rebrand data attribute (
defaults rebrand data attribute to false,sets rebrand data attribute from mock url param) pass locally.Sent by Cursor Automation: Web compat and sec
2440ca0 to
462bcd6
Compare
There was a problem hiding this comment.
Stale comment
Injected PR Evaluation: Web Compatibility & Security
PR: Add New Tab rebrand feature flag wiring (
462bcd69)
Scope:special-pages/pages/new-tab/only — zeroinjected/,messaging/, orcaptured-globalschanges.
Web Compatibility Assessment
File Lines Severity Finding (all) — info No injected page-world code changes. This PR does not touch browser API overrides, prototype chains, or third-party script interaction surfaces. Web-compat evaluation categories for injected scripts are not applicable. special-pages/pages/new-tab/app/index.js179 info data-rebrandbody attribute follows the established NTP pattern (data-platformName,data-display,data-animation). Safe CSS hook for gated rebrand styles.special-pages/pages/new-tab/app/settings.provider.js42–45 info useNewTabPageRebranding()hook is wired but not yet consumed by components — expected for a flag-wiring PR; no runtime behavior change until follow-up styling lands.special-pages/pages/new-tab/app/components/App.module.css30–32 info Empty body[data-rebrand="true"]placeholder block. No layout/viewport impact.special-pages/pages/new-tab/app/settings.js55–61 info withFeatureState()rejects non-enabled/disabledstate values (same guard asadBlocking). Malformed native payloads are safely ignored.
Security Assessment
File Lines Severity Finding (all) — info Special-pages NTP runs in a privileged embedded browser context ( duck://), not hostile third-party pages. Injected security threat models (captured globals, message bridge, prototype attacks) are not applicable.special-pages/pages/new-tab/messages/types/settings.json30–38 info JSON Schema constrains newTabPageRebranding.statetoenabled|disabled. Referenced byinitialSetup.response.jsonfor native→web validation.special-pages/pages/new-tab/app/settings.js21, 55–61 info Defaults to { state: 'disabled' };withFeatureState()double-checks state enum before applying native override. Fail-safe when flag is absent or invalid.special-pages/pages/new-tab/app/index.js179 info data-rebrandis a static"true"/"false"string derived from validated settings — no page-controlled input, no URL/data exfiltration vector.special-pages/pages/new-tab/app/mock-transport.js617–619 info ?rebrand=enabledURL param is dev/test mock transport only; not a production trust boundary.No
nativeDataleakage, messaging transport changes,postMessageusage, dynamic code execution, or uncaptured-global concerns identified.
Risk Level
Low Risk — Special-pages-only feature-flag wiring with safe defaults, schema validation, and integration test coverage; no injected runtime, API shim, or messaging security surface changes.
Recommendations
- (info) Coordinate native platform wiring so
initialSetup.settings.newTabPageRebrandingis populated in production builds (out of scope for this repo PR, but required for the flag to take effect).- (info) When rebrand styles land, consume
useNewTabPageRebranding()in components and/or add rules underbody[data-rebrand="true"]— the hook and attribute are ready.- (info) Integration tests for default/disabled and mock-enabled states pass locally (
2/2rebrand specs green).Sent by Cursor Automation: Web compat and sec
There was a problem hiding this comment.
Stale comment
Web Compatibility & Security Review — PR #2844
Scope:
special-pages/pages/new-tabonly (+50/−2). No changes toinjected/,messaging/transports,wrapper-utils.js,captured-globals.js, or message-bridge security checks.Web Compatibility Assessment
File Lines Severity Finding special-pages/pages/new-tab/app/index.js179 info data-rebrandbody attribute follows the existingdata-animation/data-displaypattern. Safe CSS hook; defaults to"false".special-pages/pages/new-tab/app/components/App.module.css30–32 info Empty body[data-rebrand="true"]placeholder — no layout or style impact until future rules are added.special-pages/pages/new-tab/app/settings.provider.js42–45 info useNewTabPageRebranding()hook is defined but not yet consumed by components. Expected for a wiring-only PR.No API overrides, prototype modifications, DOM timing hazards, or third-party script interaction concerns. NTP runs in DDG's embedded page context, not arbitrary third-party sites.
Security Assessment
File Lines Severity Finding special-pages/pages/new-tab/messages/types/settings.json30–39 info JSON Schema constrains newTabPageRebranding.statetoenabled|disabled.special-pages/pages/new-tab/app/settings.js46–61 info withFeatureState()validates enum before accepting native settings; invalid values are ignored, preserving constructor default (disabled).special-pages/pages/new-tab/app/index.js179 info data-rebrandis derived from native-controlledinitialSetupsettings, not page/user input. NonativeDataleakage or new messaging surface.special-pages/pages/new-tab/app/mock-transport.js617–619 info ?rebrand=enabledURL param is dev/mock-only; not a production attack surface.No messaging trust-boundary changes, no uncaptured globals, no
postMessage, no dynamic code execution.Risk Level
Low Risk — Config-only feature-flag plumbing for the New Tab Page, mirroring the established
adBlockingpattern, with no injected-script or messaging security surface changes.Recommendations
- Native wiring (out of scope): Ensure platform clients populate
settings.newTabPageRebrandingininitialSetupbefore enabling the flag in production.- Follow-up PRs: When adding rebrand styles to
App.module.css, prefer design-system tokens (as in recent omnibar theming work) to avoid hardcoded colors.- Tests: Integration coverage for default
falseand mockenabledparam passes (verified locally).✅ No blocking web-compat or security issues for merge from an injected-scripts perspective.
Sent by Cursor Automation: Web compat and sec
vkraucunas
left a comment
There was a problem hiding this comment.
Please also add the rebrand query param info to the new-tab/README.md
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Injected PR Evaluation: Web Compatibility & Security
PR: Add New Tab rebrand feature flag wiring (5fa7306b)
Scope: special-pages/pages/new-tab/ only — no injected/, messaging/, or API override changes.
Web Compatibility Assessment
| File | Lines | Severity | Finding |
|---|---|---|---|
| (all) | — | info | Changes are confined to the first-party New Tab Page embedded app. No code runs in third-party page contexts, so injected-script compatibility categories (API fidelity, prototype chain, DOM safety on arbitrary sites) do not apply. |
app/components/App.module.css |
30–32 | info | Empty body[data-rebrand="true"] placeholder — no visual or layout changes in this PR. Safe scaffolding for follow-up rebrand CSS. |
app/settings.provider.js |
42–45 | info | useNewTabPageRebranding() hook is exported but not yet consumed by components in this PR. Infrastructure-only; no runtime UI impact until follow-up PRs gate styles/assets behind it. |
app/index.js |
179 | info | body[data-rebrand] follows the existing data-platform-name / data-display / data-animation pattern. Attribute is set synchronously in installGlobalSideEffects() after init — consistent with other global side effects. |
Integration tests: 2/2 rebrand attribute tests pass locally.
Security Assessment
| File | Lines | Severity | Finding |
|---|---|---|---|
| (all) | — | info | No changes to captured-globals.js, message bridge, messaging transports, postMessage, or origin validation. Special-pages run in a first-party embedded context with native-provided settings — outside the hostile third-party page threat model. |
messages/types/settings.json |
30–39 | info | newTabPageRebranding schema lacks additionalProperties: false (same as adBlocking). Low risk because withFeatureState() only accepts state: 'enabled' | 'disabled' and ignores unknown keys via object spread. |
app/settings.js |
21, 49–61 | info | Default state: 'disabled' and enum validation in withFeatureState() provide safe defaults when native omits the setting. |
app/index.js |
70, 179 | info | Setting is read from native initial-setup response only; no new notify()/request() schemas and no nativeData forwarding risk. |
Positive: Feature flag is config-gated with safe default-off behavior, matching the adBlocking pattern.
Risk Level
Low Risk — Special-pages-only settings/schema wiring with default-off feature flag, no injected runtime changes, and no security-boundary modifications.
Recommendations
- Coordinate native rollout — Platforms must include
newTabPageRebrandingininitialSetupsettings before consumers can enable rebrand UI in follow-up PRs. - (Optional) Add
additionalProperties: falseto thenewTabPageRebrandingschema object for consistency with stricter message schemas elsewhere. - Follow-up PRs should gate rebrand CSS/assets behind
body[data-rebrand="true"]oruseNewTabPageRebranding()to keep the flag remotely controllable per platform.
Sent by Cursor Automation: Web compat and sec
Co-authored-by: Cursor <cursoragent@cursor.com>
Dismissing stale approval — new commits pushed, awaiting Cursor re-review.
Dismissing stale approval — new commits pushed, awaiting Cursor re-review.


Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1216270925937865?focus=true
TD:
Related PRs:
Description
Adds NTP rebrand flag wiring to the New Tab Page settings contract.
This introduces
settings.newTabPageRebranding, defaults it to disabled when absent, allows it throughwithFeatureState, exposesuseNewTabPageRebranding(), and setsdocument.body.dataset.rebrandfor CSS gating. Also adds?rebrand=enabledmock support and integration coverage for the body data attribute.Testing Steps
npm run serveChecklist
Please tick all that apply:
Note
Low Risk
Flag plumbing and a body data attribute only; no user-visible rebrand UI yet and behavior stays off unless native config or mock enables it.
Overview
Adds config-driven wiring for a New Tab Page rebrand rollout:
newTabPageRebrandingis part of theinitialSetupsettings contract (JSON schema + generated types), merged viaSettings/withFeatureStatewith a disabled default, and surfaced asuseNewTabPageRebranding().On init, the flag sets
body[data-rebrand]to"true"or"false"so future rebrand CSS can gate onbody[data-rebrand="true"](placeholder rule added inApp.module.css). Mock/dev flows support?rebrand=enabled, and Playwright tests assert the body attribute default and when the mock param is on.Reviewed by Cursor Bugbot for commit 2255ab0. Bugbot is set up for automated code reviews on this repo. Configure here.