Seeking Alpha - Paywall remover

Enjoy Seeking Alpha without Paywall

  1. // ==UserScript==
  2. // @name Seeking Alpha - Paywall remover
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Enjoy Seeking Alpha without Paywall
  6. // @author AnonymousFriend
  7. // @match https://seekingalpha.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=seekingalpha.com
  9. // ==/UserScript==
  10. var root = document.querySelector(".root");
  11. function callback(mutationList, observer) {
  12. var _a;
  13. mutationList.forEach(function (mutation) {
  14. mutation.addedNodes.forEach(function (node) {
  15. var attr = node.attributes.getNamedItem('id');
  16. if (attr && attr.value === 'paywall') {
  17. node.remove();
  18. window.observer.disconnect();
  19. }
  20. });
  21. });
  22. root.innerHTML = window.backup;
  23. document.body.style.overflow = 'scroll';
  24. document.body.classList.remove('tp-modal-open');
  25. var modal = document.body.querySelector('.tp-modal');
  26. if (modal) {
  27. modal.remove();
  28. window.observer.disconnect();
  29. }
  30. (_a = document.body.querySelector('.tp-backdrop')) === null || _a === void 0 ? void 0 : _a.remove();
  31. }
  32. window.setTimeout(function () {
  33. window.backup = root.innerHTML;
  34. window.observer = new MutationObserver(callback);
  35. window.observer.observe(document.body, { childList: true, subtree: false });
  36. }, 2000);