claude-export
claude-export copied to clipboard
Markdown copy fails with `e is null`
I did the following on Firefox:
- copy the
md.min.jsscript from https://github.com/ryanschiang/claude-export/blob/main/dist/md.min.js using theCopy raw fileicon - open a Claude 3.5 Sonnet chat (URL is like
https://claude.ai/chat/<uuid>) - open the JS console by hitting
F12and clicking on theConsoletab - paste and execute the
md.min.jsscript by hittingCtrl-VandEnter
I got the following error:
Uncaught TypeError: e is null debugger eval code:1:1191
exports debugger eval code:1
<anonymous> debugger eval code:1
<anonymous> debugger eval code:1
<anonymous> debugger eval code:1
I un-minified md.min.js using unminify and ran that on the same chat. Now the error is:
Uncaught TypeError: e is null debugger eval code:60:30
exports debugger eval code:60
<anonymous> debugger eval code:81
<anonymous> debugger eval code:157
<anonymous> debugger eval code:158
In the un-minified script, the mentioned lines with some context are:
55 361: (e) => {
56 e.exports = function () {
57 var e = document.querySelector("div.flex-1.flex.flex-col.gap-3.px-4.pt-16"),
58 t = document.querySelector("button[data-testid='chat-menu-trigger']"),
59 n = t ? t.textContent : "";
** 60 return {
elements: e.querySelectorAll(
"div.font-claude-message, div.font-user-message"
),
title: n
};
61 };
62 },
(the word elements on line 60 starts in column 30)
76 (e = r(255)),
77 (t = r(380)),
78 (n = r(361)),
79 (function () {
80 var o = "",
** 81 a = n(),
82 r = a.elements,
83 c = a.title,
84 i = t();
153 f.nodeType === Node.TEXT_NODE && (o += "\n");
154 }
155 }
156 e(console, "md", c), console.save(o);
** 157 })();
** 158 })();
(script ends on line 158)
Thank you for your contribution! The issue should be fixed as Sep 24, although I missed your PR earlier.