Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10352654
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 f0c3118..76246c2 100644
--- a/build_html.js
+++ b/build_html.js
@@ -1,33 +1,31 @@
import { readFileSync } from "fs";
/**
* @param {string | undefined} har_file
* @param {[string, string][] | undefined} private_data
- * @param {string | undefined} path_prefix
*/
-export function build_html(har_file, private_data, path_prefix) {
- if (!path_prefix)
- path_prefix = "";
+export function build_html(har_file, private_data) {
+ let path_prefix = __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
Sun, Nov 2, 17:46 (14 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1030471
Default Alt Text
(1 KB)
Attached To
Mode
R171 har-analyzer
Attached
Detach File
Event Timeline
Log In to Comment