Merge commit '54e56e1b9a' into dev

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-03-12 13:53:21 -07:00
commit 49d8f41b09
2 changed files with 5 additions and 9 deletions

View file

@ -2,6 +2,7 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
import { Storage } from "@plasmohq/storage";
import { emptyArr, webhistoryToLangChainDocument } from "~utils/commons";
import { buildBackendUrl } from "~utils/backend-url";
const clearMemory = async () => {
try {
@ -130,10 +131,7 @@ const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
body: JSON.stringify(toSend),
};
const response = await fetch(
`${process.env.PLASMO_PUBLIC_BACKEND_URL}/api/v1/documents`,
requestOptions
);
const response = await fetch(await buildBackendUrl("/api/v1/documents"), requestOptions);
const resp = await response.json();
if (resp) {
await clearMemory();

View file

@ -3,11 +3,12 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
import { Storage } from "@plasmohq/storage";
import { convertHtmlToMarkdown } from "dom-to-semantic-markdown";
import { DOMParser } from "linkedom";
import { buildBackendUrl } from "~utils/backend-url";
import { getRenderedHtml, webhistoryToLangChainDocument } from "~utils/commons";
import type { WebHistory } from "~utils/interfaces";
// @ts-ignore
global.Node = {
globalThis.Node = {
ELEMENT_NODE: 1,
ATTRIBUTE_NODE: 2,
TEXT_NODE: 3,
@ -122,10 +123,7 @@ const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
body: JSON.stringify(toSend),
};
const response = await fetch(
`${process.env.PLASMO_PUBLIC_BACKEND_URL}/api/v1/documents`,
requestOptions
);
const response = await fetch(await buildBackendUrl("/api/v1/documents"), requestOptions);
const resp = await response.json();
if (resp) {
res.send({