Skip to content

Conversation

@jchicano
Copy link

🔄 Migrate to Manifest V3 for Chrome 141+ Compatibility

Overview

This PR migrates the Decreased Productivity extension from Manifest V2 to Manifest V3 to restore compatibility with Chrome 141+ and make it publishable on the Chrome Web Store again. The extension was previously delisted due to Manifest V2 deprecation.

🎯 Key Changes

Manifest V3 Migration

  • Updated manifest.json to version 3 with all required API changes
  • Converted background script to service worker architecture
  • Replaced deprecated APIs:
    • chrome.pageActionchrome.action
    • chrome.tabs.executeScriptchrome.scripting.executeScript
    • chrome.extensionchrome.runtime
  • Added proper permissions: scripting, storage, contextMenus
  • Moved host permissions to host_permissions section

Service Worker Implementation

  • Implemented localStorage shim using chrome.storage.local for service worker compatibility
  • Added proper message passing between service worker and content scripts
  • Maintained all original functionality while adapting to MV3 constraints

Bug Fixes & Improvements

  • Fixed whitelist/blacklist domain detection synchronization
  • Resolved hotkey functionality issues
  • Improved options page storage synchronization
  • Enhanced error handling and debugging capabilities
  • Fixed demo window preview functionality

Version & Documentation

  • Bumped version to 0.47.0.1 (minor version for compatibility update)
  • Updated README with fork information and installation instructions
  • Added comprehensive changelog

✅ Functionality Preserved

All original features remain intact:

  • Domain-based cloaking (whitelist/blacklist)
  • Customizable appearance settings
  • Hotkey support (Ctrl+F12, Alt+P)
  • Context menu integration
  • Icon and title customization
  • Import/Export settings
  • All cloak modes and presets

🧪 Testing

The extension has been thoroughly tested with:

  • Chrome 141+ (current version)
  • All major cloaking features
  • Hotkey functionality
  • Domain list management
  • Settings persistence
  • Cross-tab synchronization

📦 Installation

Users can install via:

  1. Download the extension files
  2. Enable Developer Mode in Chrome
  3. Load unpacked extension
  4. All functionality works immediately

🔧 Technical Details

  • Minimum Chrome Version: 88 (as required by MV3)
  • Manifest Version: 3
  • Service Worker: Yes (replaces background page)
  • Storage: chrome.storage.local with localStorage fallback
  • Content Security Policy: Updated for MV3 compliance

🎉 Result

The extension is now fully compatible with modern Chrome versions and ready for Chrome Web Store publication, maintaining 100% of its original functionality while meeting Google's latest extension requirements.


Closes: Compatibility issues with Chrome 141+
Fixes: Manifest V2 deprecation warnings
Enables: Chrome Web Store publication

This migration was completed with assistance from Cursor AI to ensure code quality and compatibility.

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