Identify and stop event

Hello,

I’m trying to stop zoom-out event on the default image viewer page, but I’m having hard time doing that.

For example, open any image, for example:

Click it, and then try to prevent zoom-out when clicking it again.
There seems to be no mouseup event registered and even if I register one and stop propagation and prevent default, nothing helps.

How can I identify what event is doing this?

Pretty sure you can’t interact with the default image viewer page at all (as in, you can’t insert a content script). You could however control the zoom level via tab properties?

You can, my ScrollAnywhere addon is working there but when user uses the left mouse scrolling then it triggers the zoom-out which I want to prevent.

Also there is one cool add-on “Better Image Viewer” that seems to be fixing it somehow, but I’m unable to identify how:

Collab with the dev of BIV and share features.

1 Like

So I’ve checked this out again and I can see that you really can’t interfere with the build in event handling, BUT you can modify whatever they are modifying… and the zooming of the image is controlled by changing a class name on the image element.

So what he is doing is reverting the changed class name on each click :slight_smile:.

EDIT:
Actually I’m totally wrong :smiley:, I don’t know how I missed this but the event (even though not visible in the Inspector) is registered as "click", not "mouseup" and can be blocked with e.stopImmediatePropagation().