# Identify and stop event

**URL:** <https://discourse.mozilla.org/t/identify-and-stop-event/36332>\
**Category:** Development\
**Created:** [February 28, 2019, 9:32am UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332 "2019-02-28T09:32:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [February 28, 2019, 9:32am UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332/1 "2019-02-28T09:32:10Z")

</div>

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:

 ![](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/f/0/f0c95fd8265c9015077023b27216436064c8d37e.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [February 28, 2019, 10:23am UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332/2 "2019-02-28T10:23:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [February 28, 2019, 10:25am UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332/3 "2019-02-28T10:25:58Z")

</div>

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:

> **[GitHub - darktrojan/betterimageviewer: Better Image Viewer for Firefox](https://github.com/darktrojan/betterimageviewer)**
>
> Better Image Viewer for Firefox

---

<div class="post-metadata">

**Author:** ![samwolfe](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@samwolfe](https://discourse.mozilla.org/u/samwolfe)\
**Post date:** [March 29, 2020, 6:12pm UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332/4 "2020-03-29T18:12:12Z")

</div>

Collab with the dev of BIV and share features.

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [April 9, 2020, 2:35pm UTC](https://discourse.mozilla.org/t/identify-and-stop-event/36332/5 "2020-04-09T14:35:21Z")

</div>

~~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 🙂.

**EDIT:**  
Actually I’m totally wrong 😃, 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()`.
