How to make my redirect.dispatch breadcrumb redirection links open in THE SAME tab?

Solved
den232
Shopify Partner
143 5 43

My js breadcrumb links always open in a new tab.  How can I force them to open in the same tab?

 

My code looks like this:

 

import createApp from "@shopify/app-bridge";
import { Redirect } from "@shopify/app-bridge/actions"; 

const host = Buffer.from(`${shop}/admin`).toString("base64");
const app = createApp({
    apiKey: fConstants.SHOPIFY_API_KEY,
    host: host,
});

const redirect = Redirect.create(app);
const url1 = Redirect.Action.ADMIN_PATH;
const url2 = "/products/";
redirect.dispatch( url1, url2 );

I tried these two code changes, but to no avail

const app = createApp({
    apiKey: fConstants.SHOPIFY_API_KEY,
    host: host,
    forceRedirect: true
});
redirect.dispatch( url1, {
  path: "/products",
  newContext: false,
});

Thanks!  jb

Accepted Solution (1)
den232
Shopify Partner
143 5 43

This is an accepted solution.

I think I got it!

    

 

const url2 = "/../../products/";

 

 For example:
 

 

    <Page
      title={`Page title`}
      backAction={{
        content: `Return to products list`,
        url: "/../../products/", 
      }}
    >

 

View solution in original post

Reply 1 (1)
den232
Shopify Partner
143 5 43

This is an accepted solution.

I think I got it!

    

 

const url2 = "/../../products/";

 

 For example:
 

 

    <Page
      title={`Page title`}
      backAction={{
        content: `Return to products list`,
        url: "/../../products/", 
      }}
    >