good first issuehacktoberfesthacktoberfest-acceptedhtmljavascript
Repository metrics
- Stars
- (6 stars)
- PR merge metrics
- (PR metrics pending)
Description
The extension uses alert() to notify the user when authors are saved or when errors occur. This can be disruptive. Improve the user experience by displaying these messages inside the popup interface itself, as dismissible messages or notification banners.
File to modify: popup.js
How to do it:
Replace alert() calls with a function that creates and appends a temporary message element to the popup's body.
Example:
function showMessage(msg, isError = false) {
const el = document.createElement('div');
el.textContent = msg;
el.className = isError ? 'popup-message error' : 'popup-message success';
document.body.appendChild(el);
setTimeout(() => el.remove(), 2500);
}
// Replace alert('Saved!') with:
showMessage('Authors saved!');
// ...and for errors:
showMessage('An error occurred', true);
Also, add basic styles to your popup CSS.