Just for fun :)
Від
// ==UserScript==
// @name PCD15
// @namespace https://kcw.kddi.ne.jp
// @include https://kcw.kddi.ne.jp/*
// @version 1.1
// @description Just for fun :)
// @author Galac
// @match http://*/*
// @grant none
// @require https://greatest.deepsurf.us/scripts/9683-rabbit-encrypt/code/Rabbit%20encrypt.js?version=50281
// ==/UserScript==
var passphrase = '';
function encrypt(mes) {
if (passphrase != '') {
var encrypted = CryptoJS.Rabbit.encrypt(mes, passphrase);
return "Pcd15@" + encrypted;
} else {
return mes;
}
}
function decrypt(textEncrypt) {
if (passphrase != '') {
try {
var decrypted = CryptoJS.Rabbit.decrypt(textEncrypt, passphrase);
return decrypted.toString(CryptoJS.enc.Utf8);
} catch (e)
{
console.log("Error:" + e.message);
return "Error format!";
}
} else {
return textEncrypt;
}
}
function validUrl() { //just accept rooms, users with a filter
var acceptLinks = ["rid19625982", "rid32581066"]; //array text of url acceptable
var currentUrl = window.location.href;
if (acceptLinks.length > 0){
for (var i = 0; i< acceptLinks.length; i++){
if (currentUrl.indexOf(acceptLinks[i]) != -1) {
return true;
}
}
return false;
}
else return false;
}
$(function() {
//Get Passphase
var url = "https://108.61.181.151/getpp";
var data = {
id : '12345',
pcode : '0000'
}
var puid = myid != null ? myid : '12345';
data.id = puid;
var pcodeToday = prompt("Private code today!");
if (pcodeToday != null) {
data.pcode = pcodeToday;
}
try {
//Ajax get passphase
$.ajax({
type: "POST",
url: url,
data: data,
dataType: 'json',
success: function (result){
if (result.status == "0") {
passphrase = result.data.pass_phase;
}
},
error: function (){
var winPr = window.open('http://108.61.181.151:3000/guide', '_blank');
winPr.focus();
}
});
} catch (e) {
var winPr = window.open('http://108.61.181.151:3000/guide', '_blank');
winPr.focus();
}
$('#_chatText').on('keydown', function(e){
if (e.which == 13) {
if (e.altKey) { // alt/option key is down
if (validUrl()) {
if (this.value.indexOf('Pcd15@') == -1 ) {
var encrT = encrypt(this.value);
this.value = encrT;
e.preventDefault();
}
}
}
}
});
$("#_chatContent").on('mouseover', 'div.chatTimeLineMessageArea', function(e){
if (validUrl()) {
//Add title
var pre = $(this).find("pre");
if (!pre.attr('dataDec')){
if (pre.text().indexOf('Pcd15@') != -1) {
var encrptVal = pre.text().replace('Pcd15@', '');
var decryptVal = decrypt(encrptVal);
pre.attr('title', decryptVal);
pre.attr('dataDec', 1);
}
}
}
});
});