User:DreZhsh/common.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary Tag: Reverted |
No edit summary |
||
(12 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'); |
|||
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; |
|||
$('mw-content-text').html('' |
|||
+ '<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 ) { |
|||
reqListener; |
|||
document.write('<big>Test</big>') |
|||
} |
|||
} |