This script reads an HAR file for GET requests and prints their URLs into javascript code. When the code is executed in the browser, it will fetch the URLs, zip each response data and download the generated zip.
Requirements: Git and Node.js
- Clone the repository:
git clone https://github.com/g-otn/har-to-js-download-snippet.git
-
Move your
.har
file to the repository folder and rename it tofile.json
-
(Optional) Edit the
index.js
file and modify the options at the beggining of the file- If the
FETCH_LIBS
option is set totrue
, install the dependencies by running:npm i
- If the
-
Run the
index.js
file to generate your snippet:
node .
- The snippet will be generated at
snippet.js
. You can use it by, for example, pasting the file content into the browser console