-
Notifications
You must be signed in to change notification settings - Fork 29
Add TypeScript types to element-hiding feature #2016
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
base: main
Are you sure you want to change the base?
Conversation
- Add JSDoc type definitions matching element-hiding.ts schema - Cast getFeatureSetting return values to proper types with fallbacks - Update function parameter types to use new JSDoc types - Add type guards for union types (ElementHidingRule) - Preserve all original comments from codebase - Fix TypeScript compilation errors with proper null checks This integrates the refactored schema types from privacy-configuration into the content-scope-scripts element-hiding feature for better type safety and maintainability.
✅ Deploy Preview for content-scope-scripts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[Beta] Generated file diffTime updated: Mon, 20 Oct 2025 12:19:09 GMT Android
File has changed Apple
File has changed Chrome-mv3
File has changed Firefox
File has changed Integration
File has changed Windows
File has changed |
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. |
selector = selector.concat(rule.selector, ','); | ||
} else { | ||
selector = selector.concat(rule.selector); | ||
} |
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.
Bug: CSS Injection Fails with Missing Selectors
The injectStyleTag
function can generate invalid CSS. When rules without a selector
property are present, the logic for building the selector string skips them but still uses the original array index for comma placement. This can result in an empty selector string or trailing commas, leading to malformed CSS like :is() {}
.
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1211479926220519?focus=true
Description
This integrates the refactored schema types from privacy-configuration into the content-scope-scripts element-hiding feature for better type safety and maintainability.
Testing Steps
Checklist
Please tick all that apply:
Note
Adds JSDoc typedefs and applies safer defaults and guards (for missing
selector
/values
) across element-hiding logic.ElementHidingValue
,ElementHidingRuleWithSelector
,ElementHidingRuleWithoutSelector
,ElementHidingRule
,ElementHidingDomain
,StyleTagException
,ElementHidingConfiguration
.ElementHidingRule
/ElementHidingValue
and related types.selector
ininjectStyleTag
andhideAdNodes
.rule.values
before callingmodify-attr
/modify-style
.getFeatureSetting
returns with explicit defaults forrules
,adLabelStrings
,useStrictHideStyleTag
,hideTimeouts
,unhideTimeouts
,mediaAndFormSelectors
.collapseDomNode
,expandNonEmptyDomNode
,modifyAttribute
,modifyStyle
,extractTimeoutRules
,injectStyleTag
,hideAdNodes
,applyRules
).Written by Cursor Bugbot for commit 8247dc4. This will update automatically on new commits. Configure here.