How to use Python webbrowser.open() to open a window on Background
Asked Answered
H

0

6

I have a program that runs

`import webbrowser
 path = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
 webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(path))
 chrome = webbrowser.get('chrome')
 chrome.open('chrome://newtab')`

Is there a way I can somehow make this program run in the background and prevent the window from popping up? I have tried chrome.open('chrome://newtab', autoraise=False), but the program still does not open the window in the background.

Housetop answered 2/9, 2015 at 4:45 Comment(5)
By background, do you mean behind all the windows on a desktop or a background process?Nelidanelie
I mean behind all of the windows, because it can be quite annoying if you are doing something while the program is running.Housetop
You mean not displaying the browser at all or just don't changing focus to the browser ?Willemstad
@Cristiano I don't want the browser to pop up every time the program runs. So I don't want to change focus to the browser.Housetop
Any luck on this? Setting autoraise=False is still giving focus to the browser tab that is opened. On Windows using Google ChromeDiscontinuity

© 2022 - 2024 — McMap. All rights reserved.