// ==UserScript==
// @name LZTConversationEsc
// @namespace http://tampermonkey.net/
// @version 1.0
// @description try to take over the world!
// @author MeloniuM
// @license MIT
// @match *://zelenka.guru/conversations/*
// @match *://lolz.guru/conversations/*
// @match *://lolz.live/conversations/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
var duck_cache = '\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t

\n\t\t\t\t\t
Выберите диалог для просмотра
\n\t\t\t\t
\n\t\t\t\n\t\t'
let loc = window.location.pathname;
if (!(loc.startsWith('/conversations/'))){
return;
}
window.addEventListener(
"keydown",
(event) => {
if (event.defaultPrevented) {
return; // Do nothing if the event was already processed
}
switch (event.key) {
case "Esc": // IE/Edge specific value
case "Escape":
if (window.location.pathname != "/conversations/"){
Im.Start.prototype.href = "/conversations/"
if (window.location.origin + "/conversations/" in Im.navigationCache){
//Im.Start.prototype.removeDialogChannel()
duck_cache = Im.navigationCache[window.location.origin + "/conversations/"]
}
Im.dialogChannelId = 0
Im.visitorChannelId = 0
Im.conversationId = 0
Im.Start.prototype.setPageUrl(Im.Start.prototype.href)
$(".ImViewContent").html(duck_cache).xfActivate()
}
break;
default:
return; // Quit when this doesn't handle the key event.
}
// Cancel the default action to avoid it being handled twice
event.preventDefault();
},
true
);
})();