- Chromium-based browser (Chrome, Edge, Brave, etc.)
- Git
-
Clone the repository:
git clone https://github.com/liuup/overleaf_vertical.git cd overleaf_vertical -
Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select the repository directory
- Open Chrome and go to
-
Make changes:
- Edit the source files directly
- Click the refresh icon on the extension card to reload changes
- For content script changes, you may need to reload the Overleaf page
overleaf_vertical/
βββ manifest.json # Extension configuration
βββ content.js # Main content script (runs on Overleaf pages)
βββ background.js # Background service worker
βββ options.html # Options page UI
βββ options.js # Options page logic
βββ icon.png # Extension icon
βββ .github/
β βββ workflows/
β βββ build.yml # GitHub Actions CI/CD
βββ images/ # Documentation images
βββ README.md # English documentation
βββ README_zh.md # Chinese documentation
βββ Installation.md # English installation guide
βββ Installation_zh.md # Chinese installation guide
βββ CHANGELOG.md # Version history
βββ DEVELOPMENT.md # This file
- Extension metadata and configuration
- Defines permissions, content scripts, and background worker
- Update version number here for releases
- Injected into Overleaf pages
- Handles:
- Toggle button injection
- Layout switching (vertical/horizontal)
- Resizable divider functionality
- PDF viewer refresh
- Service worker running in background
- Handles:
- Dynamic content script registration
- Custom domain management
- Storage synchronization
- Configuration UI for the extension
- Allows users to add/remove custom domains
- Accessible via right-click menu on extension icon
The extension automatically builds when:
- Code is pushed to
mainormasterbranch - A tag starting with
vis pushed (e.g.,v1.1.0) - Manually triggered via GitHub Actions UI
To create a release:
# Update version in manifest.json first
git add manifest.json
git commit -m "Bump version to 1.2.0"
git tag v1.2.0
git push origin main --tagsBasic Functionality:
- Extension loads without errors
- Toggle button appears in Overleaf toolbar
- Clicking toggle switches between vertical/horizontal layouts
- PDF viewer displays correctly in both modes
Resizable Divider:
- Divider is visible in vertical mode
- Divider changes color on hover
- Dragging divider adjusts split ratio
- Split ratio respects min/max constraints (10%-90%)
- PDF viewer refreshes after resize
Multi-Domain Support:
- Options page opens from extension menu
- Can add custom domain patterns
- Invalid patterns are rejected with error message
- Can remove custom domains
- Default domain cannot be removed
- Extension works on custom domains after reload
Build System:
- GitHub Actions workflow runs successfully
- Release ZIP contains only necessary files
- Extension loads from extracted release ZIP
- Content Script: Open DevTools on Overleaf page β Console tab
- Background Worker: Go to
chrome://extensions/β Click "service worker" link - Options Page: Right-click on options page β Inspect
Extension not loading:
- Check for syntax errors in manifest.json
- Verify all referenced files exist
- Check browser console for errors
Content script not running:
- Verify domain matches in manifest.json
- Check if background worker registered the script
- Reload the Overleaf page
Options not saving:
- Check chrome.storage permissions in manifest
- Verify background worker is running
- Check for errors in background worker console
- Use 2 spaces for indentation
- Use semicolons
- Use descriptive variable names
- Add comments for complex logic
- Keep functions focused and small
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - See LICENSE file for details