Skip to content

Instantly share code, notes, and snippets.

@youpy
Created February 7, 2009 08:41
Show Gist options
  • Save youpy/59833 to your computer and use it in GitHub Desktop.
Save youpy/59833 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name zShare redirect
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://www.zshare.net/audio/*
// @include http://www.zshare.net/download/*
// @description best to use with zshare_bypass plus(http://userscripts.org/scripts/show/35182)
// ==/UserScript==
(function() {
if(location.href.match(/^http:\/\/www\.zshare\.net\/audio\/(.+)$/)) {
location.href = 'http://www.zshare.net/download/' + RegExp.$1;
}
// prevent infinite loop
if(location.href.match(/download\/.+\/.+/)) {
return;
} else {
var submit = document.getElementById('imageField');
var evt = document.createEvent('MouseEvents');
evt.initEvent('click', true, true);
evt.element = function (){ return evt.target; };
submit.dispatchEvent(evt);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment