Removed clipboardjs dependency

Added copy button in rewrite
This commit is contained in:
Kevin F 2022-12-15 20:15:12 +00:00
parent 9ee71ede2c
commit 48a5fa66c7
3 changed files with 19 additions and 12 deletions

7
clipboard.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,6 @@
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>❄️</text></svg>">
<link rel="stylesheet" href="theme.css">
<title>Snow10 - text steganography</title>
<script src="clipboard.min.js"></script>
<script src="main.js" defer></script>
</head>
<body>
@ -18,7 +17,8 @@
<pre>
Threat model: person visually looking at message threads in an app such as Twitter, Matrix, Signal, documents, etc. E.g. abusive family
Encrypt the secret message using something like age or keybase before using if encryption is needed.
This is steganography, not cryptography.
Encrypt the secret message using something like pgp or age before using if encryption is needed.
Will not resist forensic analysis. Don't use it over SMS.
@ -36,6 +36,9 @@
<textarea name="inputSecret" placeholder="Secret to hide" required></textarea>
<h1>Output</h1>
<textarea name="output" readonly></textarea>
<br>
<button id="copyResult">Copy result to clipboard</button>
<br>
<input type="submit" value="Hide">
</form>

11
main.js
View File

@ -50,6 +50,17 @@ document.getElementsByClassName('decode')[0].onsubmit = function(e){
return false
}
document.getElementById('copyResult').onclick = function(){
navigator.clipboard.writeText(document.getElementsByName('output')[0].value).then(function() {
/* clipboard successfully set */
alert("Copied to clipboard")
}
).catch(function(err) {
alert("Failed to copy to clipboard")
})
}
let ternToText = function(input){