FlamedDogo99 / EaglerMobile

A userscript that allows EaglerCraft to run on mobile browsers. As of June 15, 2023, the Eagler Mobile script is directly integrated with the main EaglerCraft website!
Apache License 2.0
15 stars 19 forks source link

[Bug] Chrome for iOS tries to save or open the buttons in a new tab #15

Closed lax1dude closed 3 months ago

lax1dude commented 3 months ago

Describe the Bug

I know I'm a dumbass for installing Google's browser on my phone but it looks like this is unusable due to one of it's special features.

In order to play with this effectively I need to press and hold the buttons, but when I do that chrome tries to save the image or open it in a new tab. It looks like Google made saving the background-image of an element a feature in their app.

You can probably stop this from happening by canceling certain events although I'm not exactly sure.

image

Steps to Reproduce

Google Chrome on iOS, loaded via <script> tag

FlamedDogo99 commented 3 months ago

I’ll have to see how chrome handles everything, but it should be fairly easy to fix. It will probably either be

.mobileControl {
  pointer-events: none;
}

or

button.addEventListener(“contextmenu”, (e) => {
  e.preventDefault();
}
FlamedDogo99 commented 3 months ago

Setting pointer-events to none completely prevents you from pressing buttons 🤦

I need to do some more research on this behavior

FlamedDogo99 commented 3 months ago

This should be fixed in #20, although I did only test it with Chrome on Xcode Simulator, so holler if it hasn't been resolved

lax1dude commented 3 months ago

I tried it on my phone and it worked, no more context menu, although it is still possible to select the buttons as text. The original issue is fixed.

FlamedDogo99 commented 3 months ago

I’ll apply the same change the buttons next release.