Two easy lines for web copy to clipboard
-
Have you ever researched an effective way to copy data to the user's clipboard from your web app? Well, it has always been a pain (old methods of using some Flash technique or whatever) or basically impossible. I just stumbled upon this really cool thing which seems to be the new way to do it and I've tested in Chrome, FireFox and Edge and it works in all 3. W00t! Here's the simple code I added:
$("#passwordText").select(); // jQuery select the target element that has text you want to copy
document.execCommand("copy"); // fire the command to copy to clipboard!!!Did you already know about this and not inform me!?! :rolleyes: I been looking for it for long time. Here are more complete docs on it. Notice that those docs have been updated recently -- I think this recently (last 6 mos) became available. Only about 7 (or 20) years late. :) Interact with the clipboard - Mozilla | MDN[^] Now you can try C'YaPass and it will automatically copy your password to your clipboard so all you'll have to do is paste it at your target. C'YaPass : Never type a password again[^] 1. Add your sitekey 2. draw your pattern 3. web app copies 64 character (SHA-256 hash) to your clipboard. Use it as your password. All sitekeys are stored in your localstorage. You can delete and edit them. It will remember password requirements (length, special chars, uppercase) for site (if you set them). And now it copies the password to the clipboard for easy paste usage. That is all.
-
Have you ever researched an effective way to copy data to the user's clipboard from your web app? Well, it has always been a pain (old methods of using some Flash technique or whatever) or basically impossible. I just stumbled upon this really cool thing which seems to be the new way to do it and I've tested in Chrome, FireFox and Edge and it works in all 3. W00t! Here's the simple code I added:
$("#passwordText").select(); // jQuery select the target element that has text you want to copy
document.execCommand("copy"); // fire the command to copy to clipboard!!!Did you already know about this and not inform me!?! :rolleyes: I been looking for it for long time. Here are more complete docs on it. Notice that those docs have been updated recently -- I think this recently (last 6 mos) became available. Only about 7 (or 20) years late. :) Interact with the clipboard - Mozilla | MDN[^] Now you can try C'YaPass and it will automatically copy your password to your clipboard so all you'll have to do is paste it at your target. C'YaPass : Never type a password again[^] 1. Add your sitekey 2. draw your pattern 3. web app copies 64 character (SHA-256 hash) to your clipboard. Use it as your password. All sitekeys are stored in your localstorage. You can delete and edit them. It will remember password requirements (length, special chars, uppercase) for site (if you set them). And now it copies the password to the clipboard for easy paste usage. That is all.
:thumbsup:
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.