DT+ hider

Hides all articles that is hidden behind a paywall

当前为 2017-04-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DT+ hider
  3. // @namespace Danielv123
  4. // @version 1.0
  5. // @description Hides all articles that is hidden behind a paywall
  6. // @author Danielv123
  7. // @match https://www.dt.no/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. // remove articles on frontpage
  14. let paidArticles = document.querySelectorAll(".df-skin-paywall");
  15. for(let i = 0; i < paidArticles.length;i++){
  16. paidArticles[i].style.display = "none";
  17. }
  18. // remove articles on article pages
  19. // find the + sign and trace article box from parentElements
  20. // timeout apparently required
  21. setTimeout(function(){
  22. paidArticles = document.querySelectorAll(".am-premium-logo--imageoverlay");
  23. for(let i = 0; i < paidArticles.length;i++){
  24. paidArticles[i].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.style.display = "none";
  25. }
  26. },1000);
  27. })();