1

On Windows, calling webbrowser.open steals the e.g. keyboard input focus, and sets it to the newly opened webbrowser tab.

Is there a way to avoid this, that is: to open the page in the background ?

1 Answer 1

0

The open method has a parameter autoraise=True. If you set this to False,

webbrowser.open('https://example.com', autoraise=False)

it will try to not steal focus, with the heads-up

note that under many window managers this will occur regardless of the setting of this variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.