textgeneration of a pas...">
location.href = "javascript:document.body.textContent = '<div>text</div>';"
<div>text</div>
XbD{'|<"]bFyWT49
XbD{'|<"]bFyWT49
to the clipboard in one clickjavascript:for(var a=[],i=0;i<95;i++)a.push(String.fromCharCode(32 + i));for(var b="",i=0;i<16;i++)b+=a[Math.floor(Math.random()*95)];document.body.textContent = b;
document.body.textContent = createPassword(); function createPassword() { var PASSWORD_LENGTH = 16; var random = Math.random; var allowedChars = getAllowedCharsArr(); for (var password = "", i = 0; i < PASSWORD_LENGTH; i++) { var randomIndex = Math.floor(random() * allowedChars.length); password += allowedChars[randomIndex] } return password; } function getAllowedCharsArr() { var FIRST_ALLOWED_ASCII_CHAR_INDEX = 32; var ALLOWED_CHARS_COUNT = 95; for (var allowedChars = [], i = 0; i < ALLOWED_CHARS_COUNT; i++) { var asciiCode = FIRST_ALLOWED_ASCII_CHAR_INDEX + i; var char = String.fromCharCode(asciiCode); allowedChars.push(char) } return allowedChars; }
document.body.textContent = '<div>text</div>';
<div>text</div>
javascript:document.body.textContent = '<div>text</div>';
javascript:for(var a=[],i=0;i<95;i++)a.push(String.fromCharCode(32 + i));for(var b="",i=0;i<16;i++)b+=a[Math.floor(Math.random()*95)];var c=document.createElement('input');c.style.opacity=0;document.body.appendChild(c); c.value=b;c.style.position='fixed';c.style.zIndex=1000000;c.focus();c.select(); document.execCommand('Copy');c.remove();
copyToClipBoard(createPassword()); function copyToClipBoard(str) { var input = document.createElement('textarea'); document.body.appendChild(input); input.value = str; input.style.position = 'fixed'; input.style.zIndex = 1000000; input.style.opacity = 0; input.focus(); input.select(); document.execCommand('Copy'); input.remove(); } function createPassword() { var PASSWORD_LENGTH = 16; var random = Math.random; var allowedChars = getAllowedCharsArr(); for (var password = "", i = 0; i < PASSWORD_LENGTH; i++) { var randomIndex = Math.floor(random() * allowedChars.length); password += allowedChars[randomIndex] } return password; } function getAllowedCharsArr() { var FIRST_ALLOWED_ASCII_CHAR_INDEX = 32; var ALLOWED_CHARS_COUNT = 95; for (var allowedChars = [], i = 0; i < ALLOWED_CHARS_COUNT; i++) { var asciiCode = FIRST_ALLOWED_ASCII_CHAR_INDEX + i; var char = String.fromCharCode(asciiCode); allowedChars.push(char) } return allowedChars; }
javascript:var a = Array.apply(null, Array(127)).map(String.fromCharCode, String).slice(32);var b = Array.apply(null, Array(16)).map(() => a[Math.floor(Math.random() * 95)]).join("");var c = document.createElement('input');document.body.appendChild(c);c.value = b;c.style.position = 'fixed';c.style.zIndex = 1000000;c.style.opacity = 0;c.focus();c.select();document.execCommand('Copy');c.remove();
Source: https://habr.com/ru/post/272189/
All Articles