User:DreZhsh/common.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
DreZhsh (talk | contribs)
Created page with "→‎* * @author DreZhsh <https://fr.wikipedia.org/wiki/Discussion_utilisateur:DreZhsh> * @name ProxyCheckInBlock: var IPtocheck = mw.config.get('wgRelevantUserName') ; function reqListener () { var obj = JSON.parse(this.responseText); document.getElementById('proxy').innerHTML = obj.proxy; document.getElementById('vpn').innerHTML = obj.vpn; document.getElementById('tor').innerHTML = obj.tor; document.getElementById('fraud_score').innerHTML = obj.f..."
 
DreZhsh (talk | contribs)
No edit summary
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
mw.loader.load('https://fr.wikipedia.org/w/index.php?title=Utilisateur:DreZhsh/AbuseFilterEditTools.js&action=raw&ctype=text/javascript');
/**
* @author DreZhsh <https://fr.wikipedia.org/wiki/Discussion_utilisateur:DreZhsh>
* @name ProxyCheckInBlock
*/
var IPtocheck = mw.config.get('wgRelevantUserName') ;
function reqListener () {
var obj = JSON.parse(this.responseText);

document.getElementById('proxy').innerHTML = obj.proxy;
document.getElementById('vpn').innerHTML = obj.vpn;
document.getElementById('tor').innerHTML = obj.tor;
document.getElementById('fraud_score').innerHTML = obj.fraud_score;

var result = document.form.firstChild.innerHTML = ''
+ '<div align=center><big>Détection de Proxy/VPN</big></div><br>'
+ '<b>Proxy</b> : <div id="proxy"></div>'
* '<b>VPN</b> : <div id="vpn"></div>'
+ '<b>TOR</b> : <div id="tor"></div>'
+ '<b>Score de fraude</b> : <div id="fraud_score"></div>';


}
function Request () {
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", "https://ipqualityscore.com/api/json/report/dd7359a59516a3ccd7cbe98563d2fb1f?ip=" + IPtocheck, true);
oReq.send();
}
////////// Initialisation //////////
var re = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}$/gi ;
if (mw.config.get('wgCanonicalSpecialPageName') === 'Block') {
if ( re.test(IPtocheck) === true ) {
Request;
}
}

Latest revision as of 18:57, 20 September 2022

mw.loader.load('https://fr.wikipedia.org/w/index.php?title=Utilisateur:DreZhsh/AbuseFilterEditTools.js&action=raw&ctype=text/javascript');