Search code examples
javascriptcssexit-intent

Restore scrolling in javascript from browser inspector


In some situations a lot of sites create modal popups, and I remove these popups by deleting <div> tags with my browser's inspector (Chrome Inspector).

In a subset of these situations, the site has also removed the scrolling feature of the page, so although I restore normal browsing function by removing the modal popup, I can't scroll the page.

How would I typically restore it

Lets use www.exitintent.io as an example after you trigger the exit intent (by moving your mouse outside of the browser)


Solution

  • From the inspector remove the modal-open class on the body element or just set overflow: scroll. Then either delete or set display:none on the modal elements

    This one:

    <div class="modal fade in" id="exitIntentModal" tabindex="-1" role="dialog" aria-labelledby="exitIntentModalLabel" aria-hidden="false" style="display: block;">
    

    This one as well:

    <div class="modal-backdrop fade in"></div>