Skip to content

Instantly share code, notes, and snippets.

@AfroThundr3007730
Created June 7, 2019 20:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AfroThundr3007730/06415c8438d8b7d94b3c092c6643708d to your computer and use it in GitHub Desktop.
Save AfroThundr3007730/06415c8438d8b7d94b3c092c6643708d to your computer and use it in GitHub Desktop.
Attempts to show the non-paywalled version of Wall Street Journal articles
// ==UserScript==
// @name Remove WSJ Paywall
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Attempts to show the non-paywalled version of Wall Street Journal articles
// @author AfroThundr
// @include https://www.wsj.com/articles/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
if (document.location.pathname.indexOf('/articles/') > -1 &&
document.location.search !== '?mod=rsswn') {
if (document.location.search !== '') {
document.location.replace(
document.location.href.replace(/\?.*/, '?mod=rsswn')
);
} else {
document.location.replace(
document.location.href.replace(/$/, '?mod=rsswn')
);
}
}
})();
@AfroThundr3007730
Copy link
Author

Or perhaps this would suffice:

(function() {
    'use strict';

    if (document.location.search !== '?mod=rsswn') {
        document.location.replace(
            document.location.origin + document.location.pathname + '?mod=rsswn'
        );
    }
})();

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