Projects STRLCPY link-lock Commits 12298d4b
🤬
  • ■ ■ ■ ■ ■ ■
    decrypt/decrypt.js
    skipped 112 lines
    113 113   output.blur();
    114 114  }
    115 115   
     116 +function main() {
     117 + if (window.location.hash) {
     118 + document.querySelector("#encrypted-url").value =
     119 + `https://jstrieb.github.io/link-lock/${window.location.hash}`;
     120 + }
     121 +}
     122 + 
  • ■ ■ ■ ■
    decrypt/index.html
    skipped 45 lines
    46 46   </div>
    47 47   
    48 48   <h1>Decrypt Link Lock URLs</h1>
    49  - <p>This application is for decrypting <a href="https://github.com/jstrieb/link-lock" target="_blank">Link Lock</a> URLs without automatically redirecting. This is useful if you do not trust the source of an encrypted URL.</p>
     49 + <p>This application is for decrypting <a href="https://github.com/jstrieb/link-lock" target="_blank">Link Lock</a> URLs without automatically redirecting. This is useful if you do not trust the source of an encrypted URL. It is also useful if the URL uses a blocked protocol like <code>javascript:</code>, for example.</p>
    50 50   
    51 51   <hr />
    52 52   
    skipped 30 lines
  • ■ ■ ■ ■ ■
    index.html
    skipped 37 lines
    38 38   <p id="errortext">Error</p>
    39 39   <button onclick="main()">Try again</button>
    40 40   <a href="https://jstrieb.github.io/link-lock"><button>Lock a link</button></a>
     41 + <a href="https://jstrieb.github.io/link-lock/decrypt/" id="no-redirect" target="_blank"><button>Decrypt Without Redirect</button></a>
    41 42   </div>
    42 43  </body>
    43 44   
    skipped 2 lines
  • ■ ■ ■ ■ ■ ■
    index.js
    skipped 59 lines
    60 60   } catch {
    61 61   // Password is incorrect.
    62 62   error("Password is incorrect.");
     63 + 
     64 + // Set the "decrypt without redirect" URL appropriately
     65 + document.querySelector("#no-redirect").href =
     66 + `https://jstrieb.github.io/link-lock/decrypt/#${hash}`;
    63 67   return;
    64 68   }
    65 69   
    skipped 30 lines
Please wait...
Page is in error, reload to recover