Forum Archive

webbrowser.open appex bug?

userista

I'm not sure if this is expected behavior but webbrowser.open returns false and doesn't open the URL in the app extension (via console and via script).

JonB

https://forum.omz-software.com/topic/1988/launching-pythonista-from-1-6b-app-extension may be relevant. have you tried a webview?

userista

Hmmmm - that's odd. Workflow is able to open a URL from its app extension.

JonB

Possibly because it has a Today widget?

I am wondering if this might be possible via objc_util ( though since the extension is still broken on 32 bit devices I cannot test it), since the enforcement seems to be via review, not kernel.

JonB

Actually, maybe this:
http://stackoverflow.com/a/28037297

apparently the extension does not support openUrl, but it is still possible to walk up the responder chain to find the UIApplication. This looks doable in objc_util. There is another solution that uses NSClassFromString to get a UIApplication, that might be diable with ctypes...

userista

Sweet! I'll try that - thanks!