Load an embedded app in Shopify store dashboard with a ui-title-bar present with AppBridge latest via <script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
Open devtools in Chrome browser
Click to Console tab
Select the app-iframe window/frame
Try to change the document title by typing javascript: document.title = 'Anything';<ENTER>
Expected behavior
Example code in Shopify documentation should work as specified.
Contextual information
Workaround is to use document.getElementsByTagName('ui-title-bar')[0].setAttribute('title', 'Anything') which works as expected.
Packages and versions
@shopify/app-bridge @ 1.23.0
No other packages in play, plain HTML, vanilla Javascript
Polaris CSS v6 stylesheet used in this case, but no Polaris React
Describe the bug
Shopify documentation here: https://shopify.dev/docs/api/app-bridge-library/web-components/ui-title-bar states that setting
document.title
in javascript should change the TitleBar display text value. But this does not work, doing so has no effect.To Reproduce
Steps to reproduce the behavior:
<script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
Console
tabapp-iframe
window/framedocument.title = 'Anything';
<ENTER>
Expected behavior
Example code in Shopify documentation should work as specified.
Contextual information
Workaround is to use
document.getElementsByTagName('ui-title-bar')[0].setAttribute('title', 'Anything')
which works as expected.Packages and versions
@shopify/app-bridge
@1.23.0
Platform