Skip to content

Commit 3b75dad

Browse files
committed
fix: chatgpt memories import (supermemoryai#597)
- ChatGPT changed there DOM with new UI, this PR will fix the import to supermemory feature with chatgpt new UI
1 parent dfb0c05 commit 3b75dad

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

apps/browser-extension/entrypoints/content/chatgpt.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ function addSupermemoryButtonToMemoriesDialog() {
209209

210210
if (memoriesDialog.querySelector("#supermemory-save-button")) return
211211

212+
212213
const deleteAllContainer = memoriesDialog.querySelector(
213-
".mt-5.flex.justify-end",
214+
".flex.items-center.gap-0\\.5",
214215
)
215216
if (!deleteAllContainer) return
216217

@@ -267,24 +268,12 @@ async function saveMemoriesToSupermemory() {
267268
return
268269
}
269270

270-
const memoryRows = memoriesTable.querySelectorAll("tr")
271-
const memories: string[] = []
272-
273-
memoryRows.forEach((row) => {
274-
const memoryCell = row.querySelector("td .py-2.whitespace-pre-wrap")
275-
if (memoryCell?.textContent) {
276-
memories.push(memoryCell.textContent.trim())
277-
}
278-
})
279-
280-
console.log("Memories:", memories)
281-
282-
if (memories.length === 0) {
271+
if (!memoriesTable.textContent) {
283272
DOMUtils.showToast("error")
284273
return
285274
}
286275

287-
const combinedContent = `ChatGPT Saved Memories:\n\n${memories.map((memory, index) => `${index + 1}. ${memory}`).join("\n\n")}`
276+
const combinedContent = `Memories from ChatGPT:\n\n${memoriesTable.textContent}`
288277

289278
const response = await browser.runtime.sendMessage({
290279
action: MESSAGE_TYPES.SAVE_MEMORY,

apps/browser-extension/wxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineConfig({
1111
manifest: {
1212
name: "supermemory",
1313
homepage_url: "https://supermemory.ai",
14-
version: "6.0.104",
14+
version: "6.0.105",
1515
permissions: ["contextMenus", "storage", "activeTab", "webRequest", "tabs"],
1616
host_permissions: [
1717
"*://x.com/*",

0 commit comments

Comments
 (0)