replit / desktop

Replit Desktop App
116 stars 7 forks source link

Only open windows externally if window is focused #156

Closed sergeichestakov closed 6 months ago

sergeichestakov commented 6 months ago

Why

We've gotten some reports of the desktop app randomly opening pages when unfocused and in the background. I have a feeling this is due to some of our "openExternal" logic around redirecting non-Replit pages (or those not supported in the desktop app) to the user's browser instead. I'm not sure why this would be occurring in the background since this should usually only happen by the user clicking links or something triggering window.open but evidently it is. See Slack thread.

What changed

Only open external links in the user's browser if the window is actually focused. This will stop tabs from opening when the app is in the background.

Test plan

sergeichestakov commented 6 months ago

yes definitely a band-aid 😕 Not sure yet but will keep digging

sergeichestakov commented 6 months ago

corresponding web PR: https://github.com/replit/repl-it-web/pull/43941

sergeichestakov commented 5 months ago

FYI @szymonkaliski figured it out here: https://github.com/replit/repl-it-web/pull/44658