pythonista-webview
pythonista-webview copied to clipboard
ERROR: TypeError: null is not an object (evaluating 'popup.opener')
Hello Mikael
I use your module in my big script managing contacts of my neighbor who is radio-amateur.
I get the error message:
ERROR: TypeError: null is not an object (evaluating 'popup.opener')
In a web page which opens a second tab in Safari:
"href="Javascript:popupGraphic('ConfirmQSO.cfm?QSLID=782567761','',10,10,500,300)">"
Thanks for your needed help
Just checking the basics: is Javascript with uppercase first letter same as ”javascript”?
I did not change anything but thus popup works on a Mac and on Safari on iPad. Does WKWebView supports multiple tabs?
Préférence javaScriptCanOpenWindowsAutomatically is False by default, is it not the reason?
Tried with True, same problem
That works with SFSafariViewController instead of WKWebView
No tabs. (You need to build the browser around the WKWebView yourself.)
SFSafariViewController does not create a new tab but opens the popup window in the same tab. The previous page button returns to original page. No way like this?
Need to look into it, but I find it unlikely since even js popups had to be implemented separately.
M
cvpe [email protected] kirjoitti 28.4.2020 kello 19.26:
SFSafariViewController does not create a new tab but opens the popup window in the same tab. The previous page button returns to original page. No way like this?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Ok, Thanks anyway for this module.
This does not look very promising: https://stackoverflow.com/questions/39070722/wkwebview-wont-open-social-media-login-popups/39073499#39073499
I agree for the new tab but if you open the popup in the same, like SFSafariController does, it is ok
Okey, reading into this, delegate probably needs to implement webview:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
where a new webview needs to be created and returned. Not sure what will happen if we just return the same webview, but can try that as well.
In reality, my script logs to eQSL.com site of radio amateurs. But, this is not a big issue. My neighbor will use his Mac for this process which occurs very rarely. Let us forget this
Le 28 avr. 2020 à 21:41, holvi-mikael [email protected] a écrit :
Sorry to say, not yet clear what should be done by the component.
It looks like you are using some Javascript library that has a popupGraphic method, and somewhere it is referring to popup.opener which usually means the opening window, not set in this case.
Nothing here that gives me an idea what to change.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
This is interesting
This works js_script = "window.open = function(open) { return function (url, name, features) { window.location.href = url; return window; }; } (window.open);" web.add_script(js_script)
Thanks! Unfortunately, the issue that you highlighted is not only related to window.open, but also <a href>
tags with target set to ”_blank”. The WKWebView user interaction delegate would handle both, but so far I have managed only a crash or at best a blank view opening.
identified problem is half solved