Mouse 4/5 button(Go Forward & Go Back function) is not working as expected because of the default feature of Chrome
In VSCode, we have mouse back forward to navigate feature.
There're keyboard shortcuts as well as mouse buttons(four and five) to do this action.
In local VSCode, mouse buttons are working perfectly.
However, in code server, since mouse button four and five is also performing as forward and back of the websites in chrome, it will not go forward and back between files in code server but change the current website.
Meanwhile, go forward and go back is working properly in https://vscode.dev
Is it possible to add an event to prevent this default action of chrome? Like
this._register(dom.addDisposableListener(window,'popState', () => { window.history.pushState(null, '', document.URL); }))
Meanwhile, go forward and go back is working properly in https://vscode.dev
Ahh, I was going to ask you to test but you already did 👍 That's indeed a code-server issue then.
Is it possible to add an event to prevent this default action of chrome? Like
this._register(dom.addDisposableListener(window,'popState', () => {
window.history.pushState(null, '', document.URL);
}))
I wonder if this would have other unintended consequences? We'd have to double-check and investigate further.
Hitting mouse button 4 will take me back to the previous folder or login screen using browser navigation rather than going back in code.
This browser extension (enabled only on my VSCode server pages) appears to have worked around this problem for me in Chromium Edge https://chrome.google.com/webstore/detail/ffmsb-freedom-for-mouse-s/najmjkgimjhilaleingfkhedncclmmaf?hl=en
I can navigate back and forth in code using mouse buttons 4/5 and I keep default browser behaviour in all other sites
Link found from an answer here: https://www.reddit.com/r/brave_browser/comments/o85hh4/how_do_i_disable_the_mouse_4_and_mouse_5_buttons/
HTH until a similar fix for this problem can be implemented natively
@neilflatley Thank you for suggestion. I have tried this extension and very helpful. 😊