Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360296
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
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
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 8, 06:22 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034084
Default Alt Text
(1 KB)
Attached To
Mode
R171 har-analyzer
Attached
Detach File
Event Timeline
Log In to Comment