A Chrome extension that provides editor help tools for your websites, including quick article editing, cache purging, and page overlays.
- Quick Edit Article: One-click access to edit articles directly from your site
- Purge Cache: Clear cache for the current page
- Toggle Overlay: Display helpful information overlay on pages
- Article Detection: Automatically detects article pages and extracts metadata
-
Add Extension Icons
- Add icon files to the
icons/directory (see icons/README.md) - Required: icon16.png, icon32.png, icon48.png, icon128.png
- Add icon files to the
-
Configure Settings
- Open config.js
- Update the following values:
SITE_DOMAINS: Your website domainsCMS_URL: Your CMS/admin panel URLCACHE_PURGE_API: Your cache purging API endpointARTICLE_URL_PATTERNS: Regex patterns to detect article pages
-
Update Manifest Permissions
- Open manifest.json
- Update
host_permissionswith your actual domains:"host_permissions": [ "https://yourdomain.com/*", "https://www.yourdomain.com/*" ]
-
Customize Article Detection
- Open content/content.js
- Modify the
extractArticleId()function to match your site structure - Update the
getEditUrl()function to generate correct edit URLs
-
Load Extension in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select this extension directory
- The extension icon should appear in your toolbar
- Open Chrome and navigate to
Click the extension icon in your Chrome toolbar to open the popup menu.
- Only enabled on article pages
- Extracts the article ID from the current page
- Opens the CMS edit page in a new tab
- Sends a request to your cache purging API
- Works on any page
- Shows success/error status
- Shows/hides an information overlay on the page
- Displays article ID and page information
- Overlay state persists across page reloads
extension/
├── manifest.json # Extension configuration
├── config.js # Shared settings
├── popup/
│ ├── popup.html # Popup interface
│ ├── popup.css # Popup styling
│ └── popup.js # Popup logic
├── content/
│ ├── content.js # Page interaction scripts
│ └── content.css # Injected styles
├── background/
│ └── background.js # Background service worker
└── icons/ # Extension icons
The extension uses multiple methods to detect articles:
- URL Patterns: Checks URL for patterns like
/article/123 - URL Parameters: Looks for
?id=123or?article_id=123 - Meta Tags: Searches for
<meta name="article-id"> - Data Attributes: Finds elements with
data-article-id
Customize these in content/content.js to match your site.
Configure cache purging in background/background.js:
const response = await fetch(apiUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({ url: url })
});- Popup: Edit popup/popup.css
- Overlay: Edit content/content.css
- Popup: Right-click the extension icon → "Inspect popup"
- Content Script: Open DevTools on any page → Console tab
- Background: Visit
chrome://extensions/→ Click "service worker"
After modifying files:
- Go to
chrome://extensions/ - Click the refresh icon on your extension
- Reload any open tabs where the extension should run
Enable debug mode in config.js:
DEBUG: trueEdit popup/popup.html to add new buttons, then implement handlers in popup/popup.js.
Uncomment the context menu code in background/background.js to add right-click menu items.
Create an options/ directory with settings UI to let users configure:
- API keys
- CMS URLs
- Feature toggles
Add to manifest.json:
"options_page": "options/options.html"- Check that your domain is listed in
host_permissionsin manifest.json - Verify the domain matches in config.js
SITE_DOMAINS - Reload the extension and refresh the page
- The extension couldn't detect an article ID
- Customize
extractArticleId()in content/content.js for your site structure - Check browser console for errors
- Verify
CACHE_PURGE_APIis correct in config.js - Check authentication headers in background/background.js
- Look at service worker console for error messages
- Check that the content script loaded (see browser console)
- Verify content.css is being injected
- Look for z-index conflicts with your site's CSS
- Never commit API keys or tokens to version control
- Use environment-specific configuration
- Consider using chrome.storage for sensitive data
- Validate and sanitize all user inputs
- Add your extension icons
- Configure your domains and API endpoints
- Customize article detection for your site
- Test all features on your websites
- Consider adding an options page for user configuration
- Add error handling and user feedback
- Prepare for production deployment