// ==UserScript== // @name Filehippo - Replace Download Manager with Direct Links // @namespace filehippo-directlinks // @author conquerist // @description Replaces download manager links on filehippo.com with direct download links. Works on download pages and update checker results page. // @include /^https?://update\.filehippo\.com/update/check/.*$/ // @include /^https?://filehippo\.com/download.*$/ // @version 1.0 // @grant none // @downloadURL none // ==/UserScript== if( window.location.pathname.match(/^\/update\/check\//) ) { // point links on update checker results to direct download var as = document.querySelectorAll('a.update-download-link') for(var i = 0; i < as.length; i++) { as[i].href = as[i].href + '/?direct' } } else if( window.location.pathname.match(/^\/download/) ) { // remove text "Download Manager Enabled" var e = document.getElementById('program-header-download-link-dm-text') e.parentNode.removeChild(e) // remove additional direct download link e = document.getElementById('direct-download-link-container') a = e.querySelector('a') var direct_onclick = a.getAttribute('onclick') var direct_href = a.getAttribute('href') e.parentNode.removeChild(e) // modify regular download links var div = document.querySelector('div.program-header-download-link-container') as = div.querySelectorAll('a') as[0].setAttribute('href', direct_href) as[0].setAttribute('onclick', direct_onclick) as[1].setAttribute('href', direct_href) as[1].setAttribute('onclick', direct_onclick) div.className = div.className.replace(/\s+download-manager-enabled/,'') as[0].className = as[0].className.replace(/\s+download-manager-enabled/,'') }