Skip to content

Conversation

@Zacgoose
Copy link
Contributor

@Zacgoose Zacgoose commented Jan 8, 2026

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 DetectionRulesManager is refactored to accept a ConfigManager instance, allowing it to use the same configuration retrieval logic.

Should fix: #122

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.
@Zacgoose Zacgoose force-pushed the storage-loading-fix branch from 7ba299a to cada22d Compare January 8, 2026 00:35
@Zacgoose Zacgoose marked this pull request as ready for review January 8, 2026 00:35
Copilot AI review requested due to automatic review settings January 8, 2026 00:35
Copy link
Contributor

Copilot AI left a 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 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.

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.

1 participant