Socket
Socket
Sign inDemoInstall

pagecrypt

Package Overview
Dependencies
3
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.0 to 4.0.0

29

CHANGELOG.md
# Changelog for `pagecrypt`
## 4.0.0 - 2021-04-29
Major UX and performance improvements!
This version uses `document.write()` to show the encrypted payload instead of using an `<iframe>` like `pagecrypt < v4` did. Since this means browsers won't have to create a separate DOM instance, this brings good performance improvements.
### Features
- feature(UX): Major UX improvement - save CryptoKey to `sessionStorage` to gain massive UX + performance improvement on repeat visits.
- feature(UX): Show results faster by removing the `<iframe>` and show content directly in the top-level document instead.
- feature(DX): By removing the `<iframe>`, we also now allow embedded apps and webpages to use the full top-level document. Unlocks many new possible features that wouldn't work in `pagecrypt < v4`.
- feature(UX): Show a loading state when loading large encrypted payloads.
- feature(UX): Show loading spinner when decrypting for better UX.
- feature(UX): Improve perceived loading performance by not blocking the main thread on page load.
- This was achieved in part by the loading state, but also by moving the encrypted payload from a render-blocking inline `<script>` into a `<pre>` that only contains the raw data.
- This way, the browser can do more work in parallel, which speeds up the initial page load.
- feature(UX): Remove the success message and 1s timeout after successful decryption to improved perceived loading performance.
- feature(build): Improve code transformations applied at build time to optimize `decrypt-template.html`
- feature(UX): Add autofocus to password input when pageload has completed.
### Fixes
- fix(build): Remove old iframe solution that's no longer relevant
- fix(docs): Fix invalid docstring for `encryptHTML()`
---
## 3.3.0 - 2021-04-25

@@ -7,3 +34,3 @@

- Set `<iframe>` and document `title` to improve accessibility for the page.
- Set `<iframe>` and document `title` to improve accessibility for the page.

@@ -10,0 +37,0 @@ ### Fixes

9

index.js

@@ -78,3 +78,3 @@ const {

*
* @param {string} inputHTML The filename (or path) to the HTML file to encrypt.
* @param {string} inputHTML The HTML string to encrypt.
* @param {string} password The password which will be used to encrypt + decrypt the content.

@@ -90,4 +90,7 @@ * @returns A promise that will resolve with the encrypted HTML content

return templateHTML.replace(
'/*{{ENCRYPTED_PAYLOAD}}*/""',
`"${await getEncryptedPayload(inputHTML, password)}"`,
/<!--ENCRYPTED PAYLOAD-->/,
`<pre class="hidden">${await getEncryptedPayload(
inputHTML,
password,
)}</pre>`,
)

@@ -94,0 +97,0 @@ }

{
"name": "pagecrypt",
"version": "3.3.0",
"version": "4.0.0",
"description": "Easily add client-side password-protection to your Single Page Applications and HTML files.",

@@ -11,3 +11,3 @@ "main": "index.js",

"build": "vite build",
"postbuild": "rm -rf web/build/assets",
"postbuild": "node scripts/postbuild.js",
"serve": "sirv web/build --http2 --key priv.pem --cert cert.pem"

@@ -14,0 +14,0 @@ },

@@ -1,6 +0,6 @@

# PageCrypt - Password Protected Single Page Applications and HTML files
# 🔐 PageCrypt - Password Protected Single Page Applications and HTML files
> Easily add client-side password-protection to your Single Page Applications and HTML files.
Inspired by [MaxLaumeister/PageCrypt](https://github.com/MaxLaumeister/PageCrypt). Thanks for sharing an excellent starting point to create this tool!
Inspired by [MaxLaumeister/PageCrypt](https://github.com/MaxLaumeister/PageCrypt), but rewritten to use native `Web Crypto API` and greatly improve UX + security. Thanks for sharing an excellent starting point to create this tool!

@@ -7,0 +7,0 @@ ## Get started

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc