We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c939089 + 0400f86 commit 87c1865Copy full SHA for 87c1865
websocket/findMetadata.ts
@@ -61,8 +61,10 @@ export const findMetadata = (
61
62
const fileUrlPattern = new RegExp(
63
`${
64
- location?.origin ?? "https://scrapbox.io"
65
- }/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
66
+ (globalThis as any).location?.origin ??
67
+ "https://scrapbox.io"}/files/([a-z0-9]{24})(?:|\\.[a-zA-Z0-9]+)(?:|\\?[^\\s]*)$`,
68
);
69
70
const lookup = (node: Node) => {
0 commit comments