GoogleScholarExtension is a Safari web extension that provides quick access to Google Scholar search results directly from your browser. The extension allows you to search academic papers based on the current tab's title or custom search terms, view citations, and interact with Google Scholar's features without leaving your browser.
Current version: 1.0 (refactored popup to a reliable single-file modular script for Safari)
- Instant Search: Automatically searches Google Scholar using the current tab's title
- Accurate Title Seeding: Reads publisher metadata when available for precise paper titles
- Custom Search: Allows manual search input for specific queries
- Rich Results: Displays comprehensive search results including:
- Paper titles with direct links
- Author information and publication details
- Article snippets/abstracts
- Citation counts
- Related articles links
- Version information
- Citation Management:
- View citations in multiple formats (MLA, APA, etc.)
- One-click copy for citations
- Modal dialog for better citation viewing
-
Clone the repository:
git clone https://github.com/yourusername/GoogleScholarExtension.git
-
Open the project in Xcode:
- Navigate to the project directory
- Open
GoogleScholarExtension.xcodeproj
-
Build and run the project:
- Select the appropriate scheme
- Build and launch the application
-
Enable in Safari:
- Open Safari Preferences
- Go to Extensions tab
- Enable GoogleScholarExtension
- Click the extension icon in Safari's toolbar
- The extension will automatically search using the current tab's title
- You can:
- Modify the search query and press Enter or click Search
- Click on paper titles to open them
- Use "Cite" to view and copy citations
- Access "Cited by", "Related articles", and version information
The extension consists of several key components:
popup.html: Minimal shell that loads the popup script.popup.js: Single-file modular script containing:- Utils: text cleanup, number parsing, element helper, URL normalization
- Services: active tab title + background messaging for Scholar and citations
- Scholar: search HTML parsing + citation URL builder
- Dom: rendering and event wiring for results
- Citations: modal with copy-to-clipboard and export links
background.js: Performs cross-origin fetches to Scholar and citation pages with the correct headers.manifest.json: Extension configuration and permissions.
See docs/ARCHITECTURE.md for a deeper dive into code organization and data flow.
When you open the popup, it seeds the search field using the active page's best-available title:
- Priority:
meta[name="citation_title"]meta[name="dc.Title"],meta[name="DC.title"],meta[property="og:title"],meta[name="twitter:title"],meta[name="parsely-title"]- Fallback to the tab title
- Normalization removes common suffixes like
" | <site/venue>".
This improves accuracy over relying on the generic tab title alone.
- Safari on macOS only. The popup and background scripts use the WebExtension
browserAPI exclusively; there is nochromefallback.
- Search Processing: Uses Google Scholar's search API with proper headers
- Citation Management: Implements a modal dialog system for citation viewing
- Result Parsing: Processes HTML responses to extract structured academic information
- User Interface: Responsive design with loading states and error handling
- Designed for Safari on macOS
- Requires Safari 14.0 or later
- macOS 11.0+
- Xcode 14.0+
- macOS 11.0 or later
- Safari 14.0+
docs/
└── ARCHITECTURE.md # Detailed architecture and flow
GoogleScholarExtension Extension/
└── Resources/
├── popup.html # Main extension interface
├── popup.js # Single-file modular popup logic
├── background.js # Background processing (fetch)
├── manifest.json # Extension configuration
└── images/ # Extension icons
- Architecture overview:
docs/ARCHITECTURE.md
The extension uses the following permissions:
activeTab: temporary access to the current page so the popup can read title metadata.scripting: enables content script injection via the MV3browser.scriptingAPI for metadata extraction.host_permissionsforhttps://scholar.google.com/*: allows background fetches for search results and citations.
Use the Xcode IDE:
- Open
GoogleScholarExtension.xcodeprojin Xcode - Select the "GoogleScholarExtension" scheme
- Build and run; then enable the extension in Safari
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.