realcozy / Seeking Alpha - Paywall remover

// ==UserScript==
// @name         Seeking Alpha - Paywall remover
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Enjoy Seeking Alpha without Paywall
// @author       AnonymousFriend
// @match        https://seekingalpha.com/*
// @icon         https://www.google.com/s2/favicons?domain=seekingalpha.com
// @license MIT
// ==/UserScript==

var root = document.querySelector(".root");


window.setTimeout(() => {
  window.backup = root.innerHTML;
}, 2000)

function callback(mutationList, observer) {
  mutationList.forEach((mutation) => {
    mutation.addedNodes.forEach((node) => {
      const attr = node.attributes.getNamedItem('id')
      if (attr && attr.value === 'paywall') {
        node.remove();
        root.innerHTML = window.backup;
        document.body.style.overflow = 'scroll'
      }
    })
  })
}
const observer = new MutationObserver(callback)

observer.observe(root, {
  childList: true
})