Comments (1)
Thanks for the feedback. This would be a good option to preserve the URL hash to allow for these use cases.
One idea for how to implement it in pagecrypt would be to add a custom HTML attribute data-preserve-hash
to the <pre>
element in the encrypted page, similar to how the data-i
(for password iterations) is set here: https://github.com/Greenheart/pagecrypt/blob/main/src/core.ts#L76
This would also need a change to the condition in decrypt.ts (https://github.com/Greenheart/pagecrypt/blob/main/web/decrypt.ts#L40) to preserve the hash if the data-preserve-hash
attribute is present.
To the users of pagecrypt, this should be both a CLI option and possible to send in via JS arguments. It might also be worth refactoring the pagecrypt JS API to include an options object for all configuration instead of positional arguments, since they are starting to become too many.
Welcome to submit a PR for this and I'd gladly help review and merge!
Update
Another potential solution could be to only autofill the password from the URL hash if a prefix is present. For example, magic links would start with #autofill=PWD
, where PWD
is the password string. This would fix this issue, while still allowing password autofill for those who want it. And we wouldn't need a configuration option for it. It would be a breaking change though.
from pagecrypt.
Related Issues (20)
- Convert decrypt.js to TypeScript HOT 1
- Autosubmit on focusout or add Submit button HOT 4
- Get an Error-Message HOT 3
- Add support for custom decryption HTML templates HOT 3
- Error using `pagecrypt` with Node 19 HOT 2
- Consider switching to pnpm to simplify local development and builds HOT 1
- Fix the CSS loading issue in latest test builds HOT 2
- [Request]: Be able to specify the amount of rounds for encryption/decryption. HOT 3
- Having the same key for multiple pages HOT 1
- Consider switching from PBKDF2 to argon2 for the KDF
- Page not render after submit password form HOT 1
- Minor: Improve TypeScript definition exports in published package HOT 1
- Docs: Update usage for `generatePassword()` in README HOT 1
- .
- Add Automatic Decryption if password is given through URL Parameter HOT 1
- Page altered in the decrypted version HOT 2
- Simplify clearing of the URL hash after decryption
- Improve error message in decrypt template when crypto.subtle is missing
- Location Redirects HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagecrypt.