115 Download Helper
当前为
// ==UserScript==
// @name 115 Download Helper
// @authuer ted423
// @description 115 Download Helper
// @include http://115.com/?ct=pickcode*
// @include http://115.com/?ct=file*
// @version 2015.01.29.0
// @grant GM_xmlhttpRequest
// @run-at document-end
// @namespace https://greasyfork.org/users/85
// ==/UserScript==
if(self.document.URL.indexOf('http://115.com/?ct=')!=-1){
console.log(self.document.URL);
var callback = function(records){
records.map(function(record){
if(record.addedNodes[0]){
if(record.addedNodes[0].nodeName=="#text"){
self.document.getElementsByTagName('a')[1].removeAttribute('target');
self.document.getElementsByTagName('a')[1].click();
}
//if(record.addedNodes[0].className)
//console.log(record.addedNodes[0].className);
}
})
}
var option = {
'childList': true,
'subtree': true,
};
function getDownloadUrl(URL){
GM_xmlhttprequest({
method:'HEAD',
URL:URL,
header:{
"Referer":location.href,
},
onload:function(response){
console.log(response.finalUrl);
}
});
}
if(self.document.URL.indexOf('http://115.com/?ct=pickcode')!=-1)
{
var click = new MutationObserver(callback);
click.observe(document, option);
}
else{
var Firstload = new MutationObserver(callback);
//Firstload.observe(document, option);
console.log(self.document.URL);
}
}