Unpaywall meetup.com

Remove paywall, unblur photos, enable scrolling, and re-enable dynamic content

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Unpaywall meetup.com
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Remove paywall, unblur photos, enable scrolling, and re-enable dynamic content
// @author       louietyj
// @match        https://www.meetup.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function unPaywall() {
        document.querySelectorAll('div[role="dialog"]').forEach(el => {
            if (el.textContent.includes('Join Meetup+')) {
                el.style.display = 'none';
            }
        });
        document.querySelectorAll('div[data-slot="modal-overlay"]').forEach(el => {
            el.style.display = 'none';
        });
    }

    function unblurPhotos() {
        const elements = document.querySelectorAll('[class*="blur"]');
        elements.forEach(element => {
            Array.from(element.classList).forEach(cls => {
                if (cls.includes('blur')) {
                    element.classList.remove(cls);
                }
            });
        });
    }

    function enableScrolling() {
        const style = document.createElement('style');
        style.textContent = `
            html, body {
                overflow: auto !important;
                overflow-y: auto !important;
                position: static !important;
                height: auto !important;
            }
        `;
        document.head.appendChild(style);

        window.addEventListener('wheel', function (e) {
            e.stopImmediatePropagation();
        }, { capture: true });
    }

    function removeLocks() {
        const svgs = document.querySelectorAll('svg[data-src="https://secure.meetupstatic.com/next/images/design-system-icons/lock-outline.svg"]');
        svgs.forEach(svg => {
            svg.remove();
        });
    }

    function removeInert() {
        document.querySelectorAll('.inert, [inert]').forEach(el => {
            el.classList.remove('inert');
            el.removeAttribute('inert');
        });
    };

    function run() {
        unPaywall();
        unblurPhotos();
        enableScrolling();
        removeLocks();
        removeInert();
    }

    //window.addEventListener('load', run);
    const observer = new MutationObserver(run);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();