Code Monkey home page Code Monkey logo

Comments (1)

Greenheart avatar Greenheart commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.