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 dcf92e0 commit 36c400fCopy full SHA for 36c400f
packages/sync-host/src/index.ts
@@ -53,7 +53,14 @@ export class HostSync extends Sync {
53
54
this.iframe = iframe;
55
56
- this.iframe.src = url + this.getState();
+ try {
57
+ const {origin, pathname, search} = new URL(url);
58
+ const updatedPathname = pathname === '/' ? '' : pathname;
59
+ this.iframe.src = `${origin}${updatedPathname}${this.getState()}${search}`;
60
+ } catch (error) {
61
+ this.iframe.src = url + this.getState();
62
+ console.error('Invalid URL of iframe', url);
63
+ }
64
65
!this.iframe['iFrameResizer'] &&
66
iFrameResize(
0 commit comments