Skip to content

Instantly share code, notes, and snippets.

@ssig33
Forked from ftnk/QueryCutter.user.js
Last active December 9, 2015 17:58
Show Gist options
  • Save ssig33/4306680 to your computer and use it in GitHub Desktop.
Save ssig33/4306680 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Query Cutter
// @namespace http://www.ftnk.jp/userscripts
// @description Cut '?ref=rss', and so on
// @include http://*
// ==/UserScript==
(function (){
var newUrl = location.href;
// delete rss for Cnet Japan, barks, etc
// delete utm* added by feedburner
// delete feature for YouTube
// for japan.linux.com
newUrl = newUrl.replace(/(\?|\&)((ref=|from=)?rss$|utm.+|fb_.+|feature=player_embedded|topic=[0-9]*)/ig, '');
if ( newUrl != location.href ) history.replaceState(null, "", newUrl);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment