How can I return to the admin product page from an app in Shopify?

Topic summary

A developer is building a Shopify embedded app with an extension on the Admin Product Page. They need to redirect users back to the specific product page that opened the app.

The Problem:

  • Direct URL redirects fail because Shopify sets X-Frame-Options to ‘deny’, preventing the admin URL from displaying in an iframe
  • Standard redirects from within an embedded app are blocked

Proposed Solution:
One respondent suggested using Shopify’s App Bridge API with the Redirect action, specifically Redirect.Action.ADMIN_SECTION with Redirect.ResourceType.Product. They provided a JavaScript/React code example.

Working Solution:
The original poster found a workaround for their C# project:

  • Use jsRuntime.InvokeAsync to execute JavaScript that opens the product URL with "_top" as the target parameter
  • This forces the request to jump outside the iframe used by Shopify to display the app
  • Not perfect, but functional for their use case
Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Hello,

I am developing an Embeded App for Shopify, and I have created an Extension that is on the Admin Product Page on the top menu that opens my App page.

On that page, I want to return to the admin product page that openned the App Page, so I tried to redirect directly to: “https://admin.shopify.com/store/mystore/products/8545732395300”.

The problem is that shopify will show an error: Refused to display ‘https://admin.shopify.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

How can I do this? A simple redirect is not possible from an App?

Bet regards,

Ricardo

I also needed a feature like yours. Following the steps will likely be beneficial for you too. You can see detail. You can review the details in the document below.

https://shopify.dev/docs/api/app-bridge/previous-versions/actions/navigation/redirect-navigate

import {useAppBridge} from "@shopify/app-bridge-react";
import {Redirect} from '@shopify/app-bridge/actions';
export default function Create() {
  const app = useAppBridge();
  const redirect = Redirect.create(app);

  redirect.dispatch(Redirect.Action.ADMIN_SECTION, {
    name: Redirect.ResourceType.Product,
     resource: {
       id: '123',
     }
  });
}

Thank you for the answer, but my project is in C#… so I cannot use that…

I ended up with finding a solution, not perfect but a working solution…

string url = "https://admin.shopify.com/store/" + domain + "/products/" + shopifyProductId.ToString ("");
// Because the App opens in a Frame inside shopify, we need to pass the parameter "_top"
await jsRuntime.InvokeAsync

With this solution, the url request jumps outside the IFrame used by shopify to display the App, and it works.