I have a page that should access window.safari.pushNotification . Everything works fine when you load this page. However, when this page is included in the iframe window.safari not undefined .
This problem occurs even if you are on the same origin and even add
sandbox="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"
does not solve the problem.
Is this supposed behavior or error? Is there any window.safari accessing window.safari from inside the iframe? (I really need it)
To reproduce this question is simple. Just add the following code to the page and try:
- download it directly
- include it in another page using iframe
window.addEventListener('load', function () { console.log('safari' in window) });
javascript safari iframe
collimarco
source share