www.DN.se paywall remover

I got tired of the paywall www.dn.se introduced a while ago. They allow non paying readers to read a limited number of posts per week or so, thereafter you will be shown a paywall instead of the content of the article.

I came up with a idea that I possibly could write a Tampermonkey script to remove the paywall. After a short investigation i found out that the paywall was just some client-side scripts that blocked the visibility of the articles. I guess the obvious reasons for this is that they try to make google and other bots think the paywall doesn’t exist. I guess that google could possible give some SEO penalties for this, google is getting better and better in running javascript. I wonder how they think about that on DN.

So if you use Tampermonkey in Google Chrome you can add the following script.

  1. Open Tampermonkey dashboard
  2. Press the add button
  3. Paste the following script and press save
// ==UserScript==
// @name DN remove ads
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Remove www.dn.se Paywall that hides the artcicle
// @author Mattias Andersson
// @match http://www.dn.se/*
// @grant none
// ==/UserScript==

(function() {
 'use strict';
 function lookForPaywall() {
   // Check if paywall is visble
   if($('.js-paywall:visible').length > 0){
     // Remove paywall
     $('.js-paywall').hide();
     // Show hidden content
     $('.article__premium-content').show();
     // Remove fading mask
     $('.article__body ').removeClass('article__body--mask');
   }
   else{
     // If paywall is not yet shown, check in a while if it have      appeared (it normally appears a couple of seconds after page load)
     setTimeout(lookForPaywall, 500);
   }
 }
 lookForPaywall();
})();

 

One Reply to “www.DN.se paywall remover”

Leave a Reply

Your email address will not be published. Required fields are marked *