I have an application that uses Chromium Embedded Framework. As an alternative for a setup where CEF is not usable (Python 3.10+ for example), I would like to fallback to a webbrowser to launch a local webapp.
Since I don't have any hook to pass data to the webapp without CEF, I tried to pass a configuration string through a GET parameter. I don't know why, but the query string disappears when I use one with the file:// protocol
example :
webbrowser.open_new_tab('https://google.com?foo=bar') # this works.
webbrowser.open_new_tab('file:///c:/some/dir/somefile.html?foo=bar') # this doesn't works.
on the second example. A browser window is open and the URL in the address bar is file:///c:/some/dir/somefile.html
Any idea?
#
instead of?
to pass arguments (i.e. instead of usingwindow.location.search
, usewindow.location.hash
).http.server
might be enough if what you have is effective a single page client-side only webapp. Just run it long enough to serve everything the client requires and terminate it.