Description
Bug description
In certain situations gp preview requires a user click before the Simple Browser opens a preview
I believe I have finally been able to consistently reproduce this issue in situations where the browser window running the Gitpod workspace does not have focus such as in the case of a multiple monitor workflow or a single monitor worflow where two windows are sharing the same screen but the window with the Gitpod workspace running in it doesn't have focus.
Also the below elements were also present in in my project repository when I was able to consistently reproduce this issue:
- The port to be previewed is set to
onOpen: ignore
in.gitpod.yml
gp preview $(gp url $port)
fires off from a.gitpod.yml
task (where$port
is whatever port you want to preview).
I have created a repository that I am pretty sure isolates the issue.
Steps to reproduce
- Create a new workspace from this repository
- Take focus away from the browser window that is running the workspace by clicking on another window but keep the original window visible.
- Wait for the build to finish
The preview browser should automatically open 3 seconds after the build finishes from the "Preview" terminal but nothing happens until you give the browser window focus by clicking anywhere on it.
Workspace affected
Expected behavior
Simple Browser should open without user interaction when a gp preview
call is made even if the browser window does not have focus.
Example repository
https://github.com/apolopena/gp-preview-bug