Skip to content

Commit 0faacac

Browse files
committed
Display HCL in popup window
1 parent 755a714 commit 0faacac

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

wasm/violentmonkey.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,19 @@ function dumpToHcl() {
613613
});
614614

615615
hclOutput.onclick = function() {
616-
alert(hcl);
616+
let winHtml = `<!DOCTYPE html>
617+
<html>
618+
<head>
619+
<title>HCL Export</title>
620+
</head>
621+
<body>
622+
<pre>${hcl}</pre>
623+
</body>
624+
</html>`;
625+
const winUrl = URL.createObjectURL(
626+
new Blob([winHtml], { type: "text/html" })
627+
);
628+
let win = window.open(winUrl, "HCL Export", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=768,height=768");
617629
};
618630
})
619631
.catch(function(error) {

0 commit comments

Comments
 (0)