Skip to content

Instantly share code, notes, and snippets.

@isoteemu
Created June 25, 2015 21:37
Show Gist options
  • Save isoteemu/3ad6ada0c18cd8cb283d to your computer and use it in GitHub Desktop.
Save isoteemu/3ad6ada0c18cd8cb283d to your computer and use it in GitHub Desktop.
Remove paywall from helsingin sanomat / hs.fi
// ==UserScript==
// @name hs.fi paywall resetter
// @namespace maksumuuri
// @include http://www.hs.fi/*
// @version 1
// @grant none
// ==/UserScript==
/**
* Helsinginsanomat Paywall resetting
* They override localStorage.removeItem to prevent removing items from localStorage.
* This breakpoint function even seems to contain home calling function to report overtly
* smart people.
* And then they save localstorage items on initial load to anonymous function, and use
* every second running timer to restore localStorage contents from that anonymous function.
*/
// Poor design, remove their histore restore function
hs.paywall.instance.restore = function() { return false; }
// Remove their prototype function to restore native behaviour
delete window.localStorage.removeItem;
// Remove history from localStorage
window.localStorage.removeItem('_hs_hist')
@esaruoho
Copy link

says here

VM281:1 Uncaught ReferenceError: hs is not defined
    at <anonymous>:1:1

when i paste this bit of code to the Google Chrome console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment