We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f154c1 commit 8cba743Copy full SHA for 8cba743
packages/space-header/src/index.ts
@@ -9,7 +9,12 @@ import { inject } from "./inject";
9
async function main(initialSpace: string | Space, options?: Options) {
10
if (window === undefined) return console.error("Please run this script in a browser environment");
11
// Don't run on huggingface.co to avoid duplicate headers
12
- if (window.location?.origin === "https://huggingface.co") return;
+ const has_huggingface_ancestor = Object.values(
13
+ window.location?.ancestorOrigins ?? {
14
+ 0: window.document.referrer,
15
+ }
16
+ ).some((origin) => new URL(origin)?.origin === "https://huggingface.co");
17
+ if (has_huggingface_ancestor) return;
18
19
inject_fonts();
20
0 commit comments