Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions websocket/findMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ export const findMetadata = (

const fileUrlPattern = new RegExp(
`${
location?.origin ?? "https://scrapbox.io"
}/files/([a-z0-9]{24})(?:|\\.[a-zA-Z0-9]+)(?:|\\?[^\\s]*)$`,
// For Node compatibility, we need to access `location` via `globalThis`
// deno-lint-ignore no-explicit-any
(globalThis as any).location?.origin ??
"https://scrapbox.io"}/files/([a-z0-9]{24})(?:|\\.[a-zA-Z0-9]+)(?:|\\?[^\\s]*)$`,
);

const lookup = (node: Node) => {
Expand Down
Loading