Skip to content

[Enhancement] CSP Compliance and User Feedback Improvements on Welcome Page #159

@ShindeNikhil8

Description

@ShindeNikhil8

📌 Summary

The current welcome.html includes inline JavaScript, which violates Chrome Extension Content Security Policy (CSP) rules and results in errors like:

In addition, there's no visual feedback for users when:

  • API key is being validated
  • An error occurs during validation
  • Theme preferences are saved

✅ Proposed Enhancements

  1. CSP Compliance

    • Move all inline <script> logic to an external welcome.js file
    • Ensures CSP compatibility for Chrome extension runtime
  2. Improved User Feedback

    • Add visible error message when API key is missing or invalid
    • Show a loading indicator or disable button during API key validation
    • Add success message when key is saved
  3. Consistent Theme Handling

    • Use chrome.storage.local instead of localStorage to store theme mode (dark/light)
    • Sync behavior with popup.js for a consistent experience

💡 Benefits

  • Resolves CSP violations and ensures proper extension loading
  • Improves usability by providing clear feedback
  • Makes code cleaner and more maintainable

📁 Files Affected

  • popup/welcome.html
  • popup/welcome.js
  • popup/popup.js (for storage consistency)

📎 Related PR

These changes are already implemented and proposed in PR #158

Let me know if you'd like me to update anything!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions