A Chrome extension to help you create PDFs from ebooks hosted on supported academic platforms. It currently supports:
- JStor
- Ebook Central by ProQuest
- Navigate to a supported ebook platform (ProQuest, JStor)
- Open an ebook you want to scrape
- Click through each page as they load to capture images
- Click the eBook Scraper extension icon in your toolbar
- Use the popup interface to save pages and compile your PDF
-
Clone the repository
git clone [email protected]:janbaykara/ebook-scraper.git cd ebook-scraper
-
Install dependencies
npm install
-
Build the extension
npm run build
-
Open Chrome Extensions page
- Navigate to
chrome://extensions/
in your Chrome browser - Or go to Chrome menu → More tools → Extensions
- Navigate to
-
Enable Developer mode
- Toggle the "Developer mode" switch in the top right corner
-
Load the extension
- Click "Load unpacked" button
- Important: Navigate to and select the
dist/
directory (the build output folder), not the root orsrc/
folder - The extension should now appear in your extensions list
-
Verify installation
- You should see "eBook Scraper" in your extensions list
- The extension icon should appear in your Chrome toolbar
- Check that the extension shows as "Active"
npm run dev
- Start development mode with hot-reloadnpm run build
- Build the extension for productionnpm run preview
- Serve the compiled production build locally from dist
Extension not loading:
- Make sure you're selecting the
dist/
directory (build output), not the root orsrc/
folder - Ensure you've run
npm run build
ornpm run watch
first - Check that
manifest.json
exists in thedist/
directory after building
Build errors:
- Try deleting
node_modules/
and runningnpm install
again - Ensure you're using Node.js version 16 or higher
ebook-scraper/
├── src/ # Source code
│ ├── js/ # TypeScript/JavaScript files
│ │ ├── common/ # Shared utilities
│ │ │ ├── sites.ts # Site configurations
│ │ │ └── utils.ts # Helper functions
│ │ ├── eventPage/ # Background script
│ │ │ ├── actions.ts # Extension actions (save, delete, etc.)
│ │ │ └── index.ts # Background script entry point
│ │ ├── popup/ # Extension popup interface
│ │ │ ├── Components.tsx # React components
│ │ │ ├── Popup.tsx # Main popup component
│ │ │ ├── index.tsx # Popup entry point
│ │ │ └── pdf.ts # PDF generation logic
│ │ └── types/ # TypeScript definitions
│ │ └── declarations.d.ts
│ ├── manifest/
| ├── plugin.ts # Vite plugin for injesting manifest site permissions
| └── template.json # Extension manifest template
├── package.json # Dependencies and scripts
├── tsconfig.json # Base TypeScript configuration
├── tsconfig.app.json # App TypeScript configuration
├── tsconfig.vite.json # Vite bundler TypeScript configuration
└── vite.config.ts # Vite configuration
This project welcomes contributions!
Please see the discussions page if you'd like to help maintain this repository.