I am trying to change the url of the midori browser after predefined intervals.

import os
import subprocess
import time

cmdline = ["midori", "-e", "Fullscreen", "-a","http://www.foo.bar"]
p = subprocess.Popen(cmdline)
cmdline = ["midori", "-e", "Fullscreen", "-a","http://www.bar.foo"]
p = subprocess.call(cmdline)

In addition I have set the the Preferences ->Open New Page in -> Current tab. But still it open new window for the second subprocess.call().

How can I open the new url in the same tab(no multiple tabs) on the same browser window?

  • You need to realize that the invocation of subprocess.call in the proposed code snippet is not sending information to the already running instance of midori but starting a new one. See here that both subprocess.Popen and subprocess.call essentially do the same thing (more or less). What you actually want to accomplish is to start midori just once and then send this very instance new commands. Which however I cannot answer. – Ghanima Apr 7 '15 at 12:48
  • I'd recommend to ask this at unix.stackexchange.com as it is really not Pi specific and might get better and faster answers over there. – Ghanima Apr 7 '15 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.