Latest
popup.js:
- Event Listeners: Added event listeners for
DOMContentLoaded
andclick
events to handle user interactions with the popup. - Display Replacements: Implemented
displaySavedReplacements()
to dynamically display the list of saved text replacements. - Add/Remove Replacements: Added functions
addReplacementPair()
andremoveReplacementPair()
to handle the addition and removal of replacement pairs. - Error Handling: Created
showError()
to display error messages in a user-friendly manner. - Tab Switching: Implemented
switchTab()
to switch between the Home and Settings tabs within the popup. - Settings Management: Added
loadSettings()
andsaveSettings()
to handle the retrieval and storage of user preferences. - Status Messages: Included
showStatus()
to provide feedback when settings are saved. - Security Enhancements: Included an
escapeHtml()
function to sanitize user input and prevent XSS attacks. - User Feedback: Ensured that error and status messages are displayed to the user, with automatic hiding after a set interval.
contentScript.js:
- Text Replacement: Created a
replaceTextOnPage()
function to replace text on the webpage according to the saved replacements and settings. - Regular Expression Escaping: Included an
escapeRegExp()
function to escape special characters in regular expressions. - Recursive Text Node Replacement: Implemented a recursive approach to find and replace text within text nodes of the DOM.
- Storage Handling: Used
chrome.storage.sync.get()
to retrieve settings and replacement pairs and apply them to the page content. - Settings Application: Added logic to check for enabled settings such as case sensitivity and whole word matching before performing text replacements.
Full Changelog: v1.2...v1.3