From 0b06dffedeef6cb647ccb5e0604ad03c97124269 Mon Sep 17 00:00:00 2001 From: Lapo Luchini Date: Sat, 14 Sep 2024 12:55:50 +0000 Subject: [PATCH] Update local usage instructions. --- README.md | 4 ++-- index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 167852e..83eab3f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ asn1js asn1js is a JavaScript generic ASN.1 parser/decoder that can decode any valid ASN.1 DER or BER structures. -An example page that can decode Base64-encoded (raw base64, PEM armoring and `begin-base64` are recognized) or Hex-encoded (or local files with some browsers) is included and can be used both [online on the official website](https://lapo.it/asn1js/) or [offline (ZIP file)](https://lapo.it/asn1js/asn1js.zip). +An example page that can decode Base64-encoded (raw base64, PEM armoring and `begin-base64` are recognized) or Hex-encoded (or local files with some browsers) is included and can be used both [online on the official website](https://asn1js.eu/) or [offline (ZIP file)](https://lapo.it/asn1js/asn1js.zip) by opening `index-local.html`. Usage with `nodejs` ------------------- @@ -67,7 +67,7 @@ document.body.innerText = ASN1.decode(Hex.decode('06032B6570')).content(); Local usage -------------------- -Since unfortunately ESM modules are not working on `file:` protocol due to [CORS issues](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts), there is a bundled [single-file version working locally](https://asn1js.eu/index-local.html). It doesn't work online (due to [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) restrictions about inline content) but can be saved locally and opened in a browser. ([known bug](https://github.com/lapo-luchini/asn1js/issues/89): dark mode is currently broken in this mode) +Since unfortunately ESM modules are not working on `file:` protocol due to [CORS issues](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts), there is a bundled [single-file version working locally](https://asn1js.eu/index-local.html). It doesn't work online (due to [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) restrictions about inline content) but can be saved locally and opened in a browser. Usage from CLI -------------------- diff --git a/index.html b/index.html index 974a304..5da0ce9 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@

ASN.1 JavaScript decoder

Instructions

This page contains a JavaScript generic ASN.1 parser that can decode any valid ASN.1 DER or BER structure whether Base64-encoded (raw base64, PEM armoring and begin-base64 are recognized) or Hex-encoded.

-

This tool can be used online at the address https://asn1js.eu/ or offline, unpacking the ZIP file in a directory and opening index.html in a browser

+

This tool can be used online at the address https://asn1js.eu/ or offline, unpacking the ZIP file in a directory and opening index-local.html in a browser.

On the left of the page will be printed a tree representing the hierarchical structure, on the right side an hex dump will be shown.
Hovering on the tree highlights ancestry (the hovered node and all its ancestors get colored) and the position of the hovered node gets highlighted in the hex dump (with header and content in a different colors).
Clicking a node in the tree will hide its sub-nodes (collapsed nodes can be noticed because they will become italic).