mirror of
https://github.com/agoramachina/claude-exporter.git
synced 2026-07-09 15:59:52 +00:00
- Export All from popup now creates a ZIP for all formats (JSON, markdown, text) instead of downloading individual files - JSON Export All now fetches full conversation data per chat (was only exporting summary list data) - background.js now re-injects jszip.min.js, utils.js, and content.js into already-open tabs (was only injecting content.js, causing "JSZip is not defined" / "downloadFile is not defined" errors) - Remove stale export_summary.json reference from browse page toast - Bump version to 1.8.8 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
// Handle extension installation
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
console.log('Claude Conversation Exporter installed');
|
|
});
|
|
|
|
// Inject content script into already-open Claude.ai tabs when extension is installed/updated
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
chrome.tabs.query({ url: 'https://claude.ai/*' }, (tabs) => {
|
|
tabs.forEach(tab => {
|
|
const files = ['jszip.min.js', 'utils.js', 'content.js'];
|
|
files.forEach(file => {
|
|
chrome.tabs.executeScript(tab.id, { file }, () => {
|
|
if (chrome.runtime.lastError) {
|
|
console.log('Could not inject', file, 'into tab', tab.id, chrome.runtime.lastError.message);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
// Handle messages from popup when content script might not be injected
|
|
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|
if (request.action === 'ensureContentScript') {
|
|
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
|
if (tabs[0]) {
|
|
const files = ['jszip.min.js', 'utils.js', 'content.js'];
|
|
let injected = 0;
|
|
files.forEach(file => {
|
|
chrome.tabs.executeScript(tabs[0].id, { file }, () => {
|
|
injected++;
|
|
if (injected === files.length) {
|
|
sendResponse({ success: true });
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|
|
return true;
|
|
}
|
|
});
|