javascript Эмуляция клика и вставки текста из -- скопировать строку в буфер обмена ctrl+c, ctrl+v (скопировать clipboard)

Задача -- загнать текст в буфер и добавить его в поле.

ОБщая идея:

document.querySelector("body").addEventListener("click", copy);

function copy()
{

// начало копирования строки в буфер
var dummy = document.createElement("input");
/* Add it to the document */
document.body.appendChild(dummy);
/*/ Set its ID */
dummy.setAttribute("id", "dummy_id");
/*/ Output the array into it */  
document.getElementById("dummy_id").value='rufromru@yandex.ru';  
/*/ Select it */
dummy.select();
document.execCommand("copy");

// окончаник копирования строки

// клик по элементу ввода
document.getElementsByClassName("mail-Compose-Field-Input")[0].childNodes[2].click()

// выполняем Ctrl+V
document.execCommand("paste");
}

-- приходится делать клик вручную, не всякий браузер разрешит:

Полезно почитать:

Key Words for FKN + antitotal forum (CS VSU):