wingify / across-tabs

Easy communication between cross-origin browser tabs. Simplified "CORS"ing!

Home Page:https://engineering.wingify.com/across-tabs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can child be opened up in same tab i.e. iframe?

mmatho opened this issue · comments

I am looking at the documentation and wondering if there is a way I can open child tab in the same window as parent. Is it possible?

Yes, by default it opens in the same window only i.e. as a tab (which is why across-tabs :) ).

var config = {
  url: 'child.html',
  windowName: 'child-tab-' + i++,
  windowFeatures: ''
};
parent.openNewTab(config);

Check the online demo here - https://engineering.wingify.com/across-tabs/live-demo.html
Or, clone the repo, npm install, and navigate to example folder, run two local servers(one for parent and other for child) and you can play with it.

Let me know if you face any issues regarding this.

Is it possible to open child in same tab as parent?

@mmatho Oh, I got it. You need an iframe to be get opened via across-tabs, right?
The current behavior of across-tabs always opens a new tab.

I'll find out a way to use it with iframe(child) within the Parent window.

Thanks for reporting this.

@softvar I would love this feature as well! I have a situation where I would like to open the child in a new tab on mobile, but open within an iframe on desktop. While across-tabs is great for the mobile case, it would be great if I could use it with iFrames as well to have a consistent messaging API.

Do you have an ETA on this feature?