Task:
I need you to craft and improve and refine a Chrome extension that modifies CORS headers to prevent CORS policy errors on all requests and responses. The extension must be highly customizable, robust, and handle all edge cases flawlessly. Please act as an expert Chrome extension developer and provide a fully working version of the code that meets the following detailed requirements.

Requirements:
CORS Handling:
Ensure all CORS headers (e.g., Access-Control-Allow-Origin, Access-Control-Allow-Methods, etc.) are correctly set on all requests, responses, and preflight (OPTIONS) requests.
The headers must be set with extreme accuracy to prevent CORS policy errors in any scenario.
Default behavior: The extension should automatically set appropriate CORS headers with valid values for all resource types and content types.
Customizability: The user should be able to define:
Which resource types or methods (GET, POST, etc.) the CORS headers should be applied to.
Which domains or webpages the CORS headers should apply to.
The values for each CORS header (either default or custom).
Ensure that all CORS headers are set before the browser receives the response.
Real-time Feedback:
Display real-time feedback in the extension popup, showing the current domain or webpage where the extension is actively modifying CORS headers.
Customizability via Popup:
Provide a popup window that allows the user to:
Enable/disable the extension.
Customise which headers are applied and their values.
Select which domains or pages the extension should operate on.
Ensure easy-to-use controls and a user-friendly interface for all customization options.
Performance & Practicality:
The extension should be straightforward, fast, powerful, and reliable.
It must work flawlessly in real-world scenarios and handle all requests and responses without adding unnecessary complexity.
Ensure the extension is practically feasible and does not introduce new issues, bottlenecks, or unintended side effects.
Edge Cases, Errors & Bottlenecks:
Handle all edge cases and potential errors (e.g., incorrect headers, conflicting policies) flawlessly.
Ensure the extension works in all possible circumstances without any CORS-related errors.
Do not add logging, rate limiting, or unnecessary complexity.
Code Quality & Improvements:
Review and analyze the existing code thoroughly.
Improve the code quality while keeping it simple, efficient, and maintainable.
Avoid unnecessary complexity and ensure the code is robust and scalable.
Use alternatives to webRequestBlocking since it only works with Manifest v2, and ensure compatibility with Manifest v3.
UI/UX Improvements:
Improve the UI/UX of the extension popup, ensuring it is intuitive and easy to navigate.
The popup should clearly show the proxy status and allow users to customize settings seamlessly.
Final Output:
Send the fully working full codes for the production ready Chrome extension.
Ensure it is tested and works perfectly in all circumstances.
Make sure the extension is ready for practical use, with no CORS-related issues in any scenario.
Additional Instructions:
Ensure the CORS headers are set with authentic and valid values.
Do not add rate limiting or logging that is not directly related to the extension's core functionality.
The extension should be highly customizable while being efficient and simple.
Always consider and handle all potential consequences of any modifications.
Test thoroughly to ensure the extension works flawlessly in real-world scenarios.
Avoid unnecessary complexity while ensuring that the extension is robust and handles all edge cases.
The extension should be able to bypass CORS policy errors perfectly in all situations, including preflight requests and complex cross-origin requests.

Please review, refine, and improve your codes or thoughts or steps accordingly, and ensure the final version is extremely powerful, efficient, reliable, user pleasing, and easy to customize.

Always Review your previous changes or responses and improve and refine them further, make it more better and robust, always think step by step.

Always consider your previous response and all of the possible or potential consequences before making any changes or modifications. Always think step by step. 

Always make what is practically feasible. Always Think broad.