caiiiycuk / js-dos

The best API for running dos programs in browser
https://js-dos.com
1k stars 123 forks source link

Browser history issues #272

Closed QuentinDallaserra closed 1 week ago

QuentinDallaserra commented 1 year ago

It seems that JS-Dos hijacks the previous and forward button on hardware mice, disallowing browsing though the history model. (Using the browser GUI button does work though).

Is there a way to completely disable mouse input as I don't require it?

caiiiycuk commented 1 year ago

Hi, js-dos dos not hijacks the navigation why do you think so?

QuentinDallaserra commented 1 year ago

Hi :). If you go to this URL: https://staging--quentin-xyz.netlify.app/ and you click on a few different icons, you will be able to use the mouse buttons (back and forward) to navigate the history. However as soon as you open the menu on the top left and click on "Another World" the back and forward functionality from the hardware mouse ceases working (But the history itself is intact as you can use the browsers GUI back and forward, which led me to believe that it was an issue with JS-Dos or more probably emulations-ui having exclusive control of the hardware).

EDIT: You may have noticed that I overlayed the initial JS-Dos logo with a custom boot screen to match the theme of the OS otherwise it's too jarring, I fully intend on crediting JS-Dos in that initial screen but have stopped developing it for now in case the history is a bug I cannot fix)

caiiiycuk commented 1 year ago

Ok, so this issue is about hardware mouse buttons? This can be because js-dos do prevent-default for mouse buttons to hide browser context menu, but this only should happen when the target of event is div with js-dos

QuentinDallaserra commented 1 year ago

Yes that would make sense but it seems to happen once and only when JS-Dos has initialized, and then even if JS-Dos is unmounted it does not want to give back mouse previous/next controls.

While I cannot right click when focusing on the JS dos windows, I can right click outside of it. I can also use alt+left arrow to navigate the history so it all seems a bit strange.

I also previously tried to recompile emulation-ui and JS-Dos having removed references to mouse events, but I must have missed something as that did not fix it.

caiiiycuk commented 1 year ago

Try to debug DOM event listeners, to see wich functions takes control