Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force refresh without switching focus #9

Open
jacobcassidy opened this issue Jan 13, 2024 · 2 comments
Open

Force refresh without switching focus #9

jacobcassidy opened this issue Jan 13, 2024 · 2 comments

Comments

@jacobcassidy
Copy link

Default refresh works as intended, but force refresh changes the app focus from VSCode to Chrome and doesn't refresh the browser.

Selecting or deselecting the Keep the focus on the browser setting seems to have no effect for force refresh.

I'm using macOS 14.2.1 and VSCode 1.85.1 on Apple M1.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Mar 7, 2024

What's your configuration for the extension? And can you check if the problem is still there in v2.0.1?

Generally I don't see an "hardReload" action support by Chrome, for example, so for that browser there's no other way that I'm aware of of doing a hard reload than to send "cmd+shift+r" to the actual browser window, which requires temporarily switching focus.


I'm not sure there's anything more the extension could do here.

@fabiospampinato fabiospampinato changed the title Force Refresh changes focus to Chrome Force refresh without switching focus Mar 23, 2024
@jacobcassidy
Copy link
Author

I looked at this again with fresh eyes and it turns out that the "System Events" is blocked from sending keystrokes
in macOS by default. That's why the focus would change to Chrome, then do nothing else.

The solution is for the user to give access to VSCode and Script Editor to control their computer via the settings in System Settings > Privacy & Security > Accessibility. And then restarting VSCode. After which the hard refresh will fully work by switching focus to the browser, doing a hard refresh, and then switching the focus back to VSCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants