Page MenuHomeSealhub

No OneTemporary

diff --git a/build_html.js b/build_html.js
index 76246c2..f5eaeaa 100644
--- a/build_html.js
+++ b/build_html.js
@@ -1,31 +1,31 @@
import { readFileSync } from "fs";
/**
* @param {string | undefined} har_file
* @param {[string, string][] | undefined} private_data
*/
export function build_html(har_file, private_data) {
- let path_prefix = __dirname;
+ let path_prefix = import.meta.dirname + "/";
let template = readFileSync(path_prefix + "src/template.html").toString('utf8');
let replacement = "";
replacement += "<script type='module'>" + readFileSync(path_prefix + "lib/src/web_entrypoint.js").toString('utf8') + '</script>';
if (har_file) {
replacement += "<script id='har_file' type='application/json'>" + har_file + '</script>';
}
template = template.replace('<!-- REPLACE ME -->', replacement);
if (private_data) {
let replacement = "";
for (const row of private_data) {
replacement += "<tr>\n"
replacement += " <td>"
replacement += row[0];
replacement += " </td>\n"
replacement += " <td>"
replacement += row[1];
replacement += " </td>\n"
replacement += "</tr>\n"
}
template = template.replace("<!-- PRIVATE INFO -->", replacement);
}
return template;
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Nov 8, 08:45 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034084
Default Alt Text
(1 KB)

Event Timeline