Skip to content

Conversation

@noisysocks
Copy link
Contributor

@noisysocks noisysocks commented Apr 2, 2025

Asana Task/Github Issue: https://app.asana.com/0/0/1209837728974673/f

Description

Adds a new Theme Color content feature that lets the browser extract the color found in a <meta name=“theme-color”>.

This is based largely on #1561.

The content feature can be enabled like so:

"features": {
  "themeColor": {
    "state": "enabled",
    "exceptions": []
  }
},

The feature then will send themeColorFound messages, which follow this schema:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "ThemeColorFound",
  "required": ["themeColor", "documentUrl"],
  "properties": {
    "themeColor": {
      "type": ["string", "null"],
      "description": "The theme color value, or null if not present"
    },
    "documentUrl": {
      "type": "string",
      "description": "The URL of the document"
    }
  }
}

Testing Steps

npm run test-int --grep theme-color

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

@noisysocks noisysocks added enhancement New feature or request minor Increment the minor version when merged labels Apr 2, 2025
@netlify
Copy link

netlify bot commented Apr 2, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 80230f1
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/67ee5867a5e80e000847c3da
😎 Deploy Preview https://deploy-preview-1609--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 site configuration.

@github-actions
Copy link

github-actions bot commented Apr 2, 2025

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

github-actions bot commented Apr 2, 2025

[Beta] Generated file diff

Time updated: Thu, 03 Apr 2025 09:45:31 GMT

Android
    - android/autofillPasswordImport.js
  • android/brokerProtection.js
  • android/contentScope.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

Apple
    - dist/contentScope.js
  • dist/contentScopeIsolated.js

File has changed

@noisysocks noisysocks force-pushed the randerson/theme-color-content-feature branch from 0410765 to 09b0a03 Compare April 3, 2025 05:23
@noisysocks noisysocks marked this pull request as ready for review April 3, 2025 08:28
@noisysocks noisysocks requested a review from a team as a code owner April 3, 2025 08:28
@noisysocks noisysocks requested review from jaceklyp and mgurgel April 3, 2025 08:35
@mgurgel mgurgel force-pushed the randerson/theme-color-content-feature branch from 708c80d to 80230f1 Compare April 3, 2025 09:44
@mgurgel
Copy link
Contributor

mgurgel commented Apr 3, 2025

"state": "disabled",
"exceptions": []
},
"themeColor": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to ask why this needs to be added in all other tests but then I found this https://github.com/duckduckgo/content-scope-scripts/pull/1561/files#r2007736395 . Let's follow up on this with @shakyShane when he's back as this means new features such as this will have ever larger PRs.

Copy link
Contributor

@mgurgel mgurgel left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@jaceklyp Will you be updating privacy-configuration as part of the Apple task or should we?

Copy link

@jaceklyp jaceklyp left a comment

Choose a reason for hiding this comment

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

LGTM!

@noisysocks
Copy link
Contributor Author

Turns out we don’t need this, and I don’t want unused code in the repo, so will close the PR. We can re-open if we need it in the future. Thanks for the help and reviews!

@noisysocks noisysocks closed this Apr 3, 2025
@noisysocks noisysocks deleted the randerson/theme-color-content-feature branch April 3, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants