Skip to content

Content scope script states#2163

Merged
jonathanKingston merged 1 commit intomainfrom
jkt/auto/contentscope-script-states-3410
Jan 16, 2026
Merged

Content scope script states#2163
jonathanKingston merged 1 commit intomainfrom
jkt/auto/contentscope-script-states-3410

Conversation

@jonathanKingston
Copy link
Contributor

@jonathanKingston jonathanKingston commented Jan 9, 2026

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1201614831475344/task/1212720272153009?focus=true

Description

Adds support for internal and preview as valid feature states, allowing features to be conditionally enabled based on platform.internal and platform.preview flags. This extends feature gating capabilities beyond simple enabled/disabled states.

Testing Steps

  • Unit tests have been added to cover the new isStateEnabled logic and feature enablement for internal and preview states.
  • To manually verify:
    • Create a feature with state: 'internal' and confirm it's enabled when platform.internal is true, and disabled otherwise.
    • Create a feature with state: 'preview' and confirm it's enabled when platform.preview is true, and disabled otherwise.

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

Introduces platform-gated feature states and updates enablement to depend on platform flags rather than only version.

  • Adds FeatureState typedef and isStateEnabled(state, platform) to gate enabled/disabled/internal/preview
  • Changes computeEnabledFeatures to accept platform (not just version), use isStateEnabled, and still honor minSupportedVersion and exceptions
  • Updates processConfig and ConfigFeature constructor to pass platform to computeEnabledFeatures
  • Updates ConfigFeature.getFeatureSettingEnabled to use isStateEnabled for both string and object settings
  • Adds unit tests covering preview/internal gating and isStateEnabled behavior

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

@cursor
Copy link

cursor bot commented Jan 9, 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 9, 2026

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 4cae275
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/696a28959a85c6000887446d
😎 Deploy Preview https://deploy-preview-2163--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

github-actions bot commented Jan 9, 2026

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

github-actions bot commented Jan 9, 2026

[Beta] Generated file diff

Time updated: Fri, 16 Jan 2026 12:02:33 GMT

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

File has changed

Apple
    - apple/contentScope.js
  • apple/contentScopeIsolated.js
  • apple/duckAiDataClearing.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

@jonathanKingston jonathanKingston marked this pull request as ready for review January 9, 2026 19:15
@jonathanKingston jonathanKingston requested a review from a team as a code owner January 9, 2026 19:15
@jonathanKingston jonathanKingston changed the title Contentscope script states Content scope script states Jan 9, 2026
This change introduces a new `isStateEnabled` utility function to correctly handle feature states like 'internal' and 'preview' based on platform flags. It also updates the `computeEnabledFeatures` and `getFeatureSettingEnabled` methods to utilize this new function, ensuring features are enabled or disabled according to the platform's capabilities. The unit tests have been updated to reflect these changes and add new test cases for the `isStateEnabled` function.

Co-authored-by: jkingston <jkingston@duckduckgo.com>
@aataraxiaa aataraxiaa force-pushed the jkt/auto/contentscope-script-states-3410 branch from f905ebd to 4cae275 Compare January 16, 2026 12:01
@aataraxiaa aataraxiaa self-requested a review January 16, 2026 13:46
Copy link

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

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

@jonathanKingston jonathanKingston merged commit d3fa511 into main Jan 16, 2026
26 checks passed
@jonathanKingston jonathanKingston deleted the jkt/auto/contentscope-script-states-3410 branch January 16, 2026 14:10
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.

3 participants