I have put my website through a performance analysis tool, and it has come back saying that there are too many scroll listeners on the document/window object.
Is there a way of finding all my scroll listeners for my document/window object?
Something maybe along the lines of :
window.scroll.listeners
We can listen to the window scroll event in a Vue.js component by calling the window.addEventListener method to listen to the scroll event on the browser window.
We call window.addEventListener with 'scroll' in the created hook to add the handleScroll scroll event listener when the component is mounted. And in the destroyed hook, we call window.renmoveListener to remove the handleScroll scroll event listener.
Show Scroll Bars in Word Scroll bars might be manually hidden. You can change this setting to show the scroll bars instead. 1 Click File > Options. 2 On the Advanced tab, scroll to the Display section. 3 Select Show horizontal scroll bar and Show vertical scroll bar, and then click OK. See More....
You can change this setting to show the scroll bars instead. Click File > Options. On the Advanced tab, scroll to the Display section. Select Show horizontal scroll bar and Show vertical scroll bar, and then click OK. Scroll bars might be set to automatically hide themselves.
If you just want to find them, you can use chrome dev tools.
Copied from answer below:
You can right click on the target element -> select "inspect element" Scroll down on the right side of the dev frame, at the bottom is 'event listeners'. Expand the tree to see what events are attached to the element. Not sure if this works for events that are handled through bubbling (I'm guessing not)
See How do I view events fired on an element in Chrome DevTools?
Also, you can programmatically do it in Chrome
getEventListeners(window)
See https://stackoverflow.com/a/16544813/227299 and https://developers.google.com/chrome-developer-tools/docs/commandline-api#geteventlistenersobject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With