mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
fix: inject URL params for share links in iframe context
This commit is contained in:
parent
2da853e9d6
commit
1922db81a2
1 changed files with 4 additions and 1 deletions
|
|
@ -19,7 +19,10 @@
|
|||
// ============================================================
|
||||
|
||||
// Parse URL parameters for deep linking: leafId and targetId
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
// Check for injected params (when loaded in iframe via srcdoc) or use window.location
|
||||
const injectedParams = document.querySelector('meta[name="pi-url-params"]');
|
||||
const searchString = injectedParams ? injectedParams.content : window.location.search.substring(1);
|
||||
const urlParams = new URLSearchParams(searchString);
|
||||
const urlLeafId = urlParams.get('leafId');
|
||||
const urlTargetId = urlParams.get('targetId');
|
||||
// Use URL leafId if provided, otherwise fall back to session default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue