Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Modal mode for `webbrowser.open()`
-
The module
webbrowser
offers the handy functionopen
which allows opening a webpage as a tab page in the console. I would have expected that when usingmodal=True
Pythonista would switch to the appropriate tab in the console which has just been loaded and let the user browse the web page. After the user presses "Done" Pythonista would return to the script (and the screen) that the call was made from. Unfortunately, this does not work for me. The web page is loaded alright, but the console is not shown. So there's no way for the user to see the page without stopping the running script. Is this intended? Thanks! -
Nobody answered so far. @omz: Could you help me with this, please? Thanks!
-
You might prefer to use a WebView, which you can pop up in a pover or sheet, that way you have control, plus your script could interact with the webview, or the webview delegate can accept callbacks from the webview, etc.
-
@JonB Yes, I might try that. It just seemed so handy to use the existing feature... :-)
-
@marcus67 you could use this WebBrowser class, it has similar functions to the built in webrowser but is written in pure Ui. It can be used modally too.
-