Releases: Ivans-Labs/Custom-Text-Replacer-Extension
Releases · Ivans-Labs/Custom-Text-Replacer-Extension
Latest - V1.4
popup.js:
- Using textContent to set text content, which avoids the risk of injecting HTML or script content inadvertently.
- Encapsulating functionality into smaller, reusable functions, which makes the code easier to read and maintain.
- Adding constants for IDs, class names, and messages to avoid typos and make changes easier.
- Adding error handling for Chrome API interactions, displaying messages to the user when something goes wrong.
popup.html:
- Improve Styling
popup.css:
- Improve styling
Full Changelog: v1.3...v1.4
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
Latest - V1.2
Full Changelog: v1.1...v1.2
First Release!
v1.1 update: readme