-
Notifications
You must be signed in to change notification settings - Fork 31
Add preview conditionalChanges support #2032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for content-scope-scripts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Temporary Branch UpdateThe 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. |
[Beta] Generated file diffTime updated: Tue, 28 Oct 2025 00:12:29 GMT Android
File has changed Apple
File has changed Chrome-mv3File has changed FirefoxFile has changed IntegrationFile has changed WindowsFile has changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for conditionalChanges based on preview build status, allowing content features to conditionally apply changes depending on whether the code is running in a preview build.
Key changes:
- Added a new
previewconditional property to the config feature system - Implemented
_matchPreviewConditionalmethod to evaluate preview conditions - Added comprehensive test coverage for preview condition matching
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| injected/src/config-feature.js | Implements the core preview conditional matching logic and registers it in the condition handlers map |
| injected/src/utils.js | Adds JSDoc documentation for the new preview property in the Platform type definition |
| injected/docs/platform-integration.md | Updates documentation to include the preview flag in platform configuration |
| injected/unit-test/content-feature.js | Adds comprehensive test suite for preview conditional matching functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I tested this PR and https://github.com/duckduckgo/windows-browser/pull/5508 together by:
"pageContext": {
"state": “enabled”,
"exceptions": [],
"settings": {
"additionalCheck": “disabled”,
"maxContentLength": 9500,
"excludeSelectors": [
".ad”,
".sidebar”,
".footer”,
".nav”,
".header”,
".banner”,
“.popup”
],
"conditionalChanges": [
{
"condition": {
“preview": true
},
"patchSettings": [
{
"op": “replace”,
"path": "/additionalCheck”,
"value": “enabled”
}
]
},
{
"condition": {
"domain": “reddit.com”
},
"patchSettings": [
{
"op": “add”,
"path": "/excludeSelectors/-“,
"value": "shreddit-comments-page-ad”
}
]
}
]
}
},
public static bool IsOneOfPreviewChannelsOrDev(this IPackageInformationProvider packageInformationProvider)
{
return true;
}I then verified that:
|
|
Oh right I’m not in @shakyShane – mind taking a look at this? |
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1211717809403184?focus=true
Description
Add support for
conditionalChangesfor preview builds.Testing Steps
Checklist
Please tick all that apply:
Note
Adds
previewbuild condition toconditionalChanges, updates Platform typings/docs, and adds unit tests.previewcondition handling ininjected/src/config-feature.js(_matchPreviewConditional) and include it in condition checks forconditionalChanges.Platformwithpreviewflag ininjected/src/utils.js.platform.previewininjected/docs/platform-integration.md.previewcondition ininjected/unit-test/content-feature.js.Written by Cursor Bugbot for commit 3132755. This will update automatically on new commits. Configure here.