How to fix hidden App Smart Banner

While posting a link to my app on Discord, someone was confused on how to open the app. The link is designed to open the app automatically but has a landing page fallback where an App Smart Banner is suppose to give them a manual option to open the app. For whatever reason discord's webkit wasn't allowing the banner to show without scrolling.

After an hour of no help from ChatGPT and even less help from Apple's documentation, StackOverflow saved the day. Someone came up with a dead simple solution. A JavaScript code that forces the window to scroll up to reveal the banner. Add that with a dedicated meta tag to display the banner this combo will definitely display your App Smart Banner.

Warning: This code by itself will scroll to the top. So a user refreshing the page will lose their place. Consider only using for certain pages or mobile only.

<meta name="apple-itunes-app" content="app-id=000, app-argument=URI://">
<script type="text/javascript">
    $(window).load(function() {
        $(window).scrollTop(-100);
    });
</script>

How to fix hidden App Smart Banner