HWM MailToTemplate

В новом письме заполняет тему и текст сообщения из URL

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        HWM MailToTemplate
// @namespace   Zeleax
// @description В новом письме заполняет тему и текст сообщения из URL
// @include /https?:\/\/(www.heroeswm.ru|178.248.235.15|www.lordswm.com)\/(sms-create.php\?mailto=.*)/
// @version     1.1
// @grant       none
// ==/UserScript==
// Пример использования: https://www.heroeswm.ru/sms-create.php?mailto=MyFriend&subject=Моя тема письма&msg=Мой текст письма
var url=window.location.href;

res=/&subject=([^&.]+)/.exec(url);
if(subjectText=res[1]) document.getElementsByName("subject")[0].setAttribute('value',decodeURI(subjectText));

res=/&msg=([^&.]+)/.exec(url);
if((msgText=res[1]) && (msgEl = document.getElementsByName("msg")[0])) msgEl.innerHTML=decodeURI(msgText);

function getI(xpath,elem){return document.evaluate(xpath,(!elem?document:elem),null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);}