1

I am trying to achieve the following:

Have a browser load when my python script starts, and sit idle in the background until it is needed, then pass the URL to the browser and bring it to the front, in full screen kiosk mode. The reason I want to load it on startup is because I want as little time possible from getting the URL to displaying, so I want to remove the actual booting up of the browser time.

To do this I am considering using the webbrowser module, as this will allow me to do all this, however I can't seem to find a way to open up the browser in full screen (kiosk) mode.

Alternatively I am able to boot up in kiosk mode from the terminal with:

os.system("chromium-browser --kiosk " + url)

However this opens a new full instance of the chromium browser, rather than just passing the URL to the already open browser as well as requiring its own Process to do, whatever its doing.

So what I am looking for is ideally a way of loading the webbrowser module in full screen mode, Or a way to comfortably pass URL's into an already loaded browser process from terminal Or a third option that will allow me to achieve what I am trying.

I am using Raspbian running on a raspberry pi 2 and have Chromium and Epiphany as available browsers.

Cheers

Aphire
  • 1,621
  • 25
  • 55
  • At first: I don't know if you have user generated URLs but if you have, consider the case of a URL like: `http://example.com/;rm -rf ~/*` and what the resulting `os.system()` call would be. – Klaus D. Jul 13 '15 at 09:52
  • That's a very good point Klaus, but luckily the user does not create the URL themselves, the links are pulled from google news, so no one can play silly buggers and break anything. – Aphire Jul 13 '15 at 09:55
  • So you will put your security into the hands of content in Google? Not a good idea. Use the `subprocess` module instead and hand in the call parameters as a list so they get properly quoted. There are examples: https://docs.python.org/2/library/subprocess.html – Klaus D. Jul 13 '15 at 09:59
  • The process wont have root, but I will still look into it. Thanks for your advise. – Aphire Jul 13 '15 at 10:07

0 Answers0