yachtworld modal stopper

Stops the modals on yachtworld

// ==UserScript==
// @name         yachtworld modal stopper
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Stops the modals on yachtworld
// @author       Zac
// @match        https://www.yachtworld.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(() => {
    'use strict';

    // Function to check if the modals exists and hide them
    const checkForModals = () => {
      if (document.getElementById('bdp-default-contact-modal'))
          document
          .getElementById('bdp-default-contact-modal')
          .style.display = 'none'

      if (document.querySelector('.ReactModalPortal'))
          document
          .querySelector('.ReactModalPortal')
          .style.display = 'none'
    }

    // Run the function initially
    checkForModals()

    // Also run the function whenever anything is added to the body
    new MutationObserver(checkForModals).observe(document.querySelector('body'), { childList: true, subtree: true })
})()