如何避免Shopify应用在新标签页中打开?

huangapple go评论58阅读模式
英文:

How to avoid Shopify app opening in a new tab?

问题

THE SITUATION:

我正在测试我的Shopify应用。<br>
直到几天前,它运行正常。<br>
预期行为是在Shopify仪表板中嵌入打开它。

最近,当我点击该应用时,它在新标签页中打开,URL如下:

<pre>
https://[STORE-ID].myshopify.com/admin/apps/[APP-NAME]?force_legacy_domain=1
</pre>

请注意URL中添加了 force_legacy_domain 参数。

SHOPIFY DOMAIN CHANGE

似乎Shopify管理员URL发生了一些变化。<br>
根据新的更改,它应该在以下URL中打开:

<pre>
https://admin.shopify.com/store/[STORE-NAME]/apps/[APP-NAME]
</pre>

QUESTION:

如何避免在新标签页中打开应用?

英文:

THE SITUATION:

I am testing my Shopify app. <br>
Until few days ago it was working fine. <br>
The intended behavior was it to be opened embedded in Shopify dashboard.

Recently when I click on the app it opens in a new tab at the following url:

<pre>
https://[STORE-ID].myshopify.com/admin/apps/[APP-NAME]?force_legacy_domain=1
</pre>

Note the force_legacy_domain param added to the url.

SHOPIFY DOMAIN CHANGE

It seems there have been some changes in the Shopify admin url. <br>
With the new change it should be opened at the following url:

<pre>
https://admin.shopify.com/store/[STORE-NAME]/apps/[APP-NAME]
</pre>

QUESTION:

How can I avoid opening the app in a new tab?

答案1

得分: 1

我认为你可以通过确保跟踪正确的参数来回答这个问题,Shopify 将不会打开新的标签页。因此,请确保在与你的应用的所有调用的生命周期中都有你的主机和商店参数。如果你没有设置主机,或者没有正确处理 admin.shopify.com 域,Shopify 将发送你到传统的处理程序,并似乎会在新标签页中打开你的应用,提醒你确保正确处理新的和旧的 Shopify 应用域的所有参数。

英文:

I think you answer this one by simply ensuring you are keeping track of the right parameters, and Shopify will not do the new tab. So ensure you have your host and shop parameters throughout the lifecycle of all calls to your App. If you are not setting the host, or handling the admin.shopify.com domain correctly, Shopify is sending you to the legacy handler, and that opens your App in a new tab it seems, reminding you to ensure you are handling all the parameters correctly for both the new and hold Shopify App domains.

答案2

得分: 0

这似乎是 Shopify 端的一个 bug。

这里有一个在 GitHub 上报告的问题:
https://github.com/Shopify/shopify-app-bridge/issues/160#issuecomment-1425990569

还有一个我在 Shopify 开发者论坛上找到的帖子:https://community.shopify.com/c/technical-q-a/force-legacy-domain-1-cascading-redirects-using-shopify-app/td-p/1938587

英文:

Looks like this may be a bug on Shopify's end.

There is a github issue reported here:
https://github.com/Shopify/shopify-app-bridge/issues/160#issuecomment-1425990569

And there is a thread I found on the Shopify developer forums: https://community.shopify.com/c/technical-q-a/force-legacy-domain-1-cascading-redirects-using-shopify-app/td-p/1938587

huangapple
  • 本文由 发表于 2023年2月8日 20:21:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/75385725.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定