postMessage not working
Opened this issue · 4 comments
When I do something like window.open and post data to that new open window in a user script, nothing works. That window couldn’t receive any message. Same code works well on safari browser or alook app.
Trying this scripts on android.
Platform: ios
App version: 2.6.3
Hi, thanks. Could you provide a small example? I'm not really sure if that's possible with the webview implementation.
Your other tests (Safari, etc.) are on mobile or desktop? You said you are trying on Android, but then also mentioned iOS as a platform.
iOS Pda
tab A:
let newWindow = window.open('https://example.com')
window.setInterval(()=>{
newWindow.postMessage('connect', '*')
},1000)
tab B (newWindow):
window.addEventListener("message", (e) => {
console.log(e.data);
}, false);
tab B (newWindow) couldn't get any message from tab A.
Sorry for the late reply, we are RWing...
I usually use iOS device, did not have a chance to test this on some Android devices. But I tested this api works well on other Browser.
BTW PDA is awsome, many of our members are using your app. Thanks a lot for your contribution!
Thanks! I'll have a look when I can. I don't think there is direct communication between tabs due to framework restrictions, but there might be a way around it with the webview implementation I use.