Redirecting a user from the application to another admin section.

Grin-Baks
Shopify Partner
2 0 1

I need to redirect the user from the application to the theme editor. Using API requests, I obtained the necessary parameters and formed a valid link. In my case, it looks like this:

 

https://admin.shopify.com/store/ju*****re/themes/13******63/editor?context=apps

All I need is for the user to click on the link or button and be directed to the desired section. It works if I add `target="_blank"` to the link, but I would like to keep the user in the same window instead of opening a new one.

 

If I remove `target="_blank"`, I see the content as shown in the screenshot. I get the same result if I execute `window.location.href = buttonUrl;`.

 

What am I doing wrong? Making a link seems like a straightforward task, but I've already spent about 4 hours on it.

 

 

 

2024-05-18_19-53-59.png

Reply 1 (1)

Grin-Baks
Shopify Partner
2 0 1

Thank you all. I figured it out. It is necessary to add target="_top" to the link, and the app-bridge will change the URL within the current page.