3 ms·
Show HN: Classified.html, encryption solution that is just a file, web/terminal
- ilon 5y agoPretty interesting idea to store the data directly into the source file. I've never seen that before, a very nice project!
- ollipal 5y agoThank you! It was not easy as different browsers process the .innerHTML in different ways... That is why I had to almost everything between script tags, event the html+css
- EvanDotPro 5y agoLove the creativity! Not only storing the data directly in the file, but also the clever hackery to make a single file that renders a page in the browser yet can also be executed in the terminal with Node. Very cool!
- ollipal 5y agoThanks a lot! The hardest part was to figure out how to get source code access through js from the browser without browser's own modifications. It seems that all browsers process 'document.documentElement.innerHTML' in different ways... That is not good if you want to have this file in version control for example. In the end the solution was to put as much as possible between <script> tags, including html + css, and then it can all be accessed perfectly with 'document.currentScript.innerHTML'. Then I just hard coded the two lines that could not be put inside the tags. All this just to ensure that the updating does not affect the source code in any way :D