A Chrome extension that checks Google Scholar search results against your personal Mendeley library in real time β and lets you add papers with a single click.
| Badge | Meaning | Action |
|---|---|---|
| β In Mendeley (green) | Paper already in your library | β |
| β Add to Mendeley (blue) | Not in library | Click to add instantly |
| β Add to Mendeley + PDF (blue) | Free PDF detected | Click to add with PDF |
| ⳠChecking⦠(gray, pulsing) | Querying your library | Wait |
| Not connected | Click extension icon |
- Matches by DOI first (exact), then fuzzy title match as fallback
- Auto-saves title, authors, year, journal, and URL to Mendeley when adding
- Tries to attach a free PDF automatically via Unpaywall and open-access sources
- Validates downloaded files are real PDFs before attaching (no corrupt files)
- Works on Google Scholar search results pages
- Handles dynamic pagination β badges appear on newly loaded results too
mendeley-scholar-checker/
βββ background.js # OAuth2 + Mendeley API logic (source β no real secrets)
βββ content.js # Scrapes Scholar, injects badges, handles click-to-add
βββ popup.html # Extension popup UI (login/logout)
βββ popup.js # Popup logic
βββ styles.css # Badge styles injected into Scholar pages
βββ manifest.json # Chrome Extension Manifest V3 config
βββ build.js # Build script: reads .env β generates dist/
βββ get_key.py # Helper: converts Extension ID β manifest key
βββ package.json # npm scripts
βββ .env.example # Template β copy to .env and fill in credentials
βββ .gitignore # Keeps .env and dist/ out of GitHub
βββ icons/ # Extension icons (16px, 48px, 128px)
βββ dist/ # β Generated by build.js (gitignored, load THIS in Chrome)
Important: Always load the
dist/folder in Chrome, not the root folder. Thedist/folder contains your credentials injected by the build script.
- Google Chrome
- Node.js v14+ β download and install from nodejs.org (just click Next through the installer)
- A Mendeley / Elsevier account β register free at mendeley.com
- Any text editor β Notepad on Windows, TextEdit on Mac, nano in terminal, anything works
No VS Code, no Git, no other tools required.
Click the green Code button on this GitHub page β Download ZIP β unzip the folder anywhere you like.
Open a terminal inside the unzipped folder:
- Windows: open the folder β click the address bar β type
cmdβ press Enter - Mac: right-click the folder β "New Terminal at Folder"
- Linux: right-click β "Open Terminal Here"
In the terminal, run:
node build.jsIt will warn about missing credentials β that's fine for now. The
dist/folder will still be created.
-
Open Chrome and go to
chrome://extensions/ -
Toggle Developer mode ON (switch in the top-right corner)
-
Click Load unpacked β select the
dist/folder inside the project -
Find Mendeley Scholar Checker in the list
-
Copy the ID shown below the name (only visible when Developer mode is ON):
ID: abcdefghijklmnopqrstuvwxyzabcdef
Without this step, Chrome assigns a new Extension ID every time you remove and re-add the extension, which breaks the login. Run this once to lock it permanently:
python3 get_key.py abcdefghijklmnopqrstuvwxyzabcdefReplace the ID with your actual ID from Step 3. On Windows you may need to use
pythoninstead ofpython3.
The output will look like:
β
Extension ID : abcdefghijklmnopqrstuvwxyzabcdef
π Key : AAAAAABBBBBBCCCCCC...
π Redirect URL : https://abcdefghijklmnopqrstuvwxyzabcdef.chromiumapp.org/
Copy both the Key and the Redirect URL β you need them in the next two steps.
-
Sign in with your Elsevier credentials (same email/password as Mendeley)
-
Click Create new app and fill in the form:
Field Value App Name Scholar Checker(or anything you like)Description Personal Chrome extension to check Mendeley libraryAuthorisation Flow ElsevierRedirect URL Paste your https://...chromiumapp.org/from Step 4 -
Click Register β copy the Client ID and Client Secret shown
β οΈ Do not click "Pack extension" onchrome://extensions/β that's unrelated and not needed here.
Copy the example credentials file:
# Mac / Linux
cp .env.example .env
# Windows (Command Prompt)
copy .env.example .env
# Windows (PowerShell)
Copy-Item .env.example .envOpen .env with any text editor and fill in all three values:
MENDELEY_CLIENT_ID=paste_your_client_id_here
MENDELEY_CLIENT_SECRET=paste_your_client_secret_here
EXTENSION_KEY=paste_your_key_here
β οΈ Never share this file or commit it to GitHub β it's already in.gitignoreso it's protected automatically.
node build.jsThen go to chrome://extensions/ β find Mendeley Scholar Checker β click β» Reload.
- Click the extension icon in the Chrome toolbar (puzzle piece icon β pin it for easy access)
- Click Connect Mendeley
- An Elsevier login window appears β sign in with your Mendeley credentials
- The popup shows Connected to Mendeley β
Go to scholar.google.com, search for any topic, and badges will appear on each result within a few seconds.
- Blue badge β click to save the paper (+ PDF if one is freely available)
- Green badge β already in your library
If you edit any source file, rebuild and reload:
node build.jsThen chrome://extensions/ β β» Reload.
| File | Goes to GitHub? | Why |
|---|---|---|
.env |
β No | Contains your real secrets |
dist/ |
β No | Contains injected secrets |
.env.example |
β Yes | Placeholder values only |
background.js |
β Yes | Placeholder values only |
manifest.json |
β Yes | Placeholder values only |
"Login error: Authorization page could not be loaded"
- Your Extension ID changed β run
python3 get_key.py <new-id>, updateEXTENSION_KEYin.env, runnode build.js, reload, and update the Redirect URL in your Mendeley app settings
"Login error: Token exchange failed: 403"
- The Redirect URL in Mendeley app settings doesn't match your Extension ID
- Go to dev.mendeley.com/myapps.html β edit your app β update the Redirect URL
"Login required" badge on every result
- Click the extension icon β reconnect (token expired)
No badges appearing
- Make sure you're on a Google Scholar search results page (URL contains
scholar.google.com/scholar?) - Confirm the popup says "Connected to Mendeley"
- Try reloading the Scholar page
"Add failed" on a paper
- Open
chrome://extensions/β click Service worker β Console tab β retry adding β paste the error here
PDF not attached
- Expected for paywalled papers (IEEE, Elsevier, Springer). The extension only attaches PDFs from free/open-access sources. The paper metadata is always saved regardless.
MIT β free to use, modify, and share.