Merged
Conversation
Updated content and detection rules manager scripts to retrieve configuration and branding data via chrome.runtime messaging to the background script, ensuring merged enterprise and local config is used. DetectionRulesManager now accepts a ConfigManager instance for improved config access. Fallbacks to local storage remain for robustness.
7ba299a to
cada22d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors configuration and branding data access throughout the extension to consistently use merged enterprise and local configuration from the background script via message passing, rather than directly accessing storage. This ensures enterprise policy overrides are properly respected across all components.
Key changes:
- DetectionRulesManager now accepts a ConfigManager instance to use merged configuration
- Content script functions updated to request config/branding from background with fallback to local storage
- All changes follow a consistent error handling pattern with proper fallbacks
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/modules/detection-rules-manager.js | Added configManager parameter to constructor and updated loadConfiguration() to use ConfigManager when available for merged config access |
| scripts/background.js | Updated DetectionRulesManager instantiation to pass ConfigManager instance |
| scripts/content.js | Updated five functions (loadDeveloperConsoleLoggingSetting, showWarningBanner's fetchBranding, showValidBadge, sendCippReport, applyBrandingColors) to request config/branding from background via messaging with fallback to local storage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates how configuration and branding data are accessed throughout the extension, ensuring that merged enterprise and local configuration is consistently retrieved from the background script rather than directly from storage. This improves reliability and maintainability, especially in environments with enterprise overrides. Additionally, the
DetectionRulesManageris refactored to accept aConfigManagerinstance, allowing it to use the same configuration retrieval logic.Should fix: #122