English | 中文
-
Chrome: See here for the main code.
The Safari and Chrome extensions share nearly identical codebases with only minimal differences:
content.js- Core functionality for page manipulationpopup.js- Extension popup interface logicpopup.html- Extension popup interface structurepopup.css- Extension popup stylingutils.js- Shared utility functions and configurations
1. Manifest Structure (manifest.json)
- Safari: Multiple icon sizes (
48px,96px,128px,256px,512px) - Safari: Icons stored in
images/folder with SVG toolbar icon - Safari: Uses
"scripting"permission (Safari-specific) - Chrome: Single
128pxicon asicon.png - Chrome: Uses
"activeTab"permission (Chrome-specific)
2. Directory Structure
- Safari only:
images/folder with multiple icon formats - Chrome only: Single
icon.pngfile
The code migration was nearly 1:1, proving excellent cross-browser compatibility. The main effort was in manifest configuration rather than code changes. Both extensions support:
- arXiv paper redirections
- GitHub repository alternatives
- Scholar Inbox integration
- Identical user interface and functionality
The Chrome extension's background.js file is not referenced in the manifest and serves no purpose. It can be safely deleted to clean up the codebase.