A Chrome extension designed to build epubs from Amazon's Kindle Reader website.
It injects into the Kindle Reader website to capture and extract base64 blob content, before the blobs get revoked.
Inspired by my desire to read the books I've purchased through Inkwell, an ebook reader app I built for myself.
Thanks to Showdown for their markdown to HTML converter.
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (top right)
- Click "Load unpacked" and select the DeKindled folder
- You should see the DeKindled extension installed
- Go to read.amazon.com
- Sign in and open a book
- Look for the "π DeKindled Active" indicator (bottom-right corner)
- If the book didn't open on the first page, go to it, then reload the page.
- Click the extension icon to open the overlay.
- Click "Start Auto-Scan" and DeKindled will click through the book, capturing content as it goes.
- When the page counter at the bottom stops increasing, the scan is complete.
- Click "Convert to EPUB" in the top right corner of the overlay
- You'll be asked for the book title and author, then your OpenAI API key
- Background processing will begin converting the images to Markdown which will then be converted to EPUB
- Once completed, a download prompt will appear
- DeKindled captures content as it's loaded by the Kindle reader. If you go backwards or change display settings, your content will be out of order!
DeKindled uses OpenAI's vision API to convert scanned book pages to markdown. You can customize the prompt that controls how the AI interprets and converts the content.
- Right-click the DeKindled extension icon in Chrome
- Select "Options" from the context menu
- Or go to
chrome://extensions/β DeKindled β "Extension options"
- In the options page, scroll to the "Analysis Prompt" section
- The large text area contains the prompt sent to OpenAI for each page
- Edit the prompt to customize how the AI processes book pages:
- Change instructions for formatting (e.g., preserve indentation differently)
- Modify chapter detection logic
- Add specific instructions for handling tables, quotes, or special formatting
- Adjust the tone or style of conversion
The default prompt instructs the AI to:
- Convert images to clean markdown
- Detect chapter titles and mark them with
--- NEW CHAPTER: [Title] --- - Handle paragraph indentation by adding line breaks
- Preserve all visible text content
- Use proper markdown formatting
- Click "Reset to Default" to restore the original prompt
- Confirm the action to replace your custom prompt
- Changes are automatically saved
- Test incrementally: Make small changes and test with a few pages
- Keep the chapter marker: The
--- NEW CHAPTER: [Title] ---format is required for proper EPUB structure - Preserve key instructions: Don't remove the core instruction to convert everything to markdown
- Be specific: Clear, detailed instructions work better than vague ones
- Consider your content: Tailor the prompt to the types of books you typically convert
β οΈ Advanced Feature: Modifying the prompt requires understanding of how AI language models work. Incorrect prompts may result in poor conversion quality or failed processing.
Web readers often generate blob URLs for content (like images, text) that get revoked immediately after creation. This extension:
- Captures blob data instantly when
URL.createObjectURL()is called - Stores base64 content before blobs get revoked
- Provides easy download of captured content
- Intercepts
URL.createObjectURL()calls - Immediately reads and stores blob content as base64
- Visual indicators show capture success/failure
- Works before blob URLs get revoked
- Stores base64 data in memory during session
- Maps blob URLs to their base64 content
- Survives blob URL revocation
- Debug info shows storage status
- Overlay viewer accessible via extension icon
- Real-time stats (captured, stored, total size)
- Storage status indicators
// When any page creates a blob URL:
URL.createObjectURL = function(blob) {
const url = originalCreateObjectURL(blob);
// Immediately read and store base64 data
readBlobAsBase64(blob).then(base64Data => {
window.__dekindled.blobData.set(url, {
base64: base64Data,
type: blob.type,
size: blob.size
});
});
return url;
}- Uses
FileReader.readAsDataURL()to convert blobs to base64 - Stores in a
Mapwith blob URL as key - Maintains metadata (type, size, timestamp)
- Survives blob revocation
- Downloads from stored base64 data when available
- Falls back to URL access if storage failed
- Batch processing for multiple files
- Proper file extensions based on MIME types
-
Clone this repository:
git clone https://github.com/yourusername/dekindled.git cd dekindled -
Load the extension in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
dekindledfolder
- Open
-
Grant permissions:
- The extension needs access to the Kindle Reader website to intercept blob creation
- Downloads permission for saving captured content
manifest.json- Extension configurationbackground.js- Service worker for extension managementinject.js- Content script injectorinterceptor.js- Core blob interception and base64 storageviewer-inject.js- Overlay UI for managing captured content
// Store base64 data immediately
window.__dekindled.blobData.set(url, {
base64: dataURL,
type: blob.type,
size: blob.size
});
// Download from stored base64
window.__dekindled.downloadStoredBlob(url, filename);
// Download all stored content
window.__dekindled.downloadAllStored();Use the included test-page.html to verify functionality:
# Open test-page.html in Chrome with extension loaded
# Should capture test blobs and show visual indicators- Ensure extension is active (blue indicator in bottom-right)
- Check browser console for DeKindled messages
- Try refreshing the page after enabling extension
- Blob was created but base64 reading failed
- Check console for FileReader errors
- May indicate binary/unsupported blob type
- Try "Try URL" button for recently created blobs
- Check if blob URL is still valid
- Verify download permissions are granted
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License
Note: This extension is designed for legitimate content preservation and so you can read your content on any device or app you choose. Buy your books and support the authors!