'"Navigation is Blocked" message on Chrome 99 / Android devices

I am managing some payment pages now.

Some online mall creates an Iframe and call our payment page.

When I click button with Chrome 99 on Android devices,

"Navigation is Blocked" message shows on browser dev console.

The code was perfectly worked before.

example code in iframe(not sandboxed) ↓

<script type="text/javascript">
function install() {
    window.top.location.href = 'market://details?id=com.some.package.name';
}
</script>

<button type="button" onclick="javascript:install();">install</button>

It is weird that this error occurs not only our payment page, but also other company's payment page.

Does anyone have similar problems? just show your case. thanks.

  • I read posts about "Navigation is Blocked" appears when open some links without an user event.

  • All docs and resources are using https protocol with reliable SSL certificates.



Solution 1:[1]

problem solved.

I ve modified "window.top.location.href" to "location.href".

I think that child element seems no longer have access to parent elements.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Goblinblaster