25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

index.html 1.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. </head>
  6. <body>
  7. <script src="../dist/lesspass.min.js"></script>
  8. <script>
  9. function displayInBody(txt) {
  10. document.body.innerHTML = document.body.innerHTML + txt + '<br>';
  11. }
  12. function displayErrorInBody(txt) {
  13. document.body.innerHTML = document.body.innerHTML + '<span style="color:red;">' + txt + '</span><br>';
  14. }
  15. function createFingerprint() {
  16. LessPass.createFingerprint('password').then(fingerprint => {
  17. displayInBody("createFingerprint :");
  18. displayInBody("e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e");
  19. displayInBody(fingerprint + " (generated)")
  20. });
  21. }
  22. function generatePassword() {
  23. const profile = {
  24. site: 'example.org',
  25. login: 'contact@example.org'
  26. }
  27. const masterPassword = 'password';
  28. LessPass.generatePassword(profile, masterPassword).then(function(generatedPassword) {
  29. displayInBody("<br>generatePassword :");
  30. displayInBody("WHLpUL)e00[iHR+w");
  31. displayInBody(generatedPassword + " (generated)")
  32. });
  33. }
  34. LessPass.isSupported().then(function(isSupported) {
  35. if (isSupported) {
  36. createFingerprint();
  37. generatePassword();
  38. }
  39. else {
  40. displayErrorInBody("LessPass is not supported on your browser!");
  41. }
  42. });
  43. </script>
  44. </body>
  45. </html>