mishig HF staff commited on
Commit
8b52b18
1 Parent(s): 74d5501

same protocol as hf spaces for iframe postMessage

Browse files
src/lib/components/InferencePlayground/InferencePlaygroundModelSelector.svelte CHANGED
@@ -35,7 +35,9 @@
35
  url.searchParams.set("modelId", model.id);
36
 
37
  const parentOrigin = "https://huggingface.co";
38
- window.parent.postMessage({ modelId: model.id }, parentOrigin);
 
 
39
 
40
  goto(url.toString(), { replaceState: true });
41
  }
 
35
  url.searchParams.set("modelId", model.id);
36
 
37
  const parentOrigin = "https://huggingface.co";
38
+ const searchParamsWithoutTheme = new URLSearchParams(url.searchParams.toString());
39
+ searchParamsWithoutTheme.delete("__theme");
40
+ window.parent.postMessage({ queryString: searchParamsWithoutTheme.toString() }, parentOrigin);
41
 
42
  goto(url.toString(), { replaceState: true });
43
  }