Is there a way to access the new tab created from a Redirect?

Is there a way to access the new tab created from a Redirect?

Kris_Doyle
Shopify Partner
141 1 45

I'm using something similar to the following snippet to redirect the user to a new tab:

 

redirect.dispatch(Redirect.Action.ADMIN_SECTION, {
section: {
name: Redirect.ResourceType.Product,
resource: {
id: id
}
},
newContext: true
});

This currently opens a new browser tab and loads the product with the specified ID. What I really need is to be able to grab a handle to the new tab so that I can detect if it has been closed.

 

I was using vanilla JS for this before (which was a little hacky), but I'd like to use AppBridge. The problem I'm running into is that I can't figure out a way to get access to that new tab. I tried subscribing to the dispatch event, but that doesn't actually work at all for some reason.

 

In any case, does anyone have any thoughts on how I could access that new window (tab) so I can detect if/when it's closed?

 

Replies 0 (0)