-
Notifications
You must be signed in to change notification settings - Fork 0
/
npm-audit-widget.html
34 lines (33 loc) · 1.07 KB
/
npm-audit-widget.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin:0;
padding:0;
}
</style>
</head>
<body>
<div id="widget" class="widget">
<h2 class="title">npm audit widget</h2>
<div class="big-count truncated-text-ellipsis">N/A</div>
<div class="footer runcated-text-ellipsis">not configured</div>
</div>
<script src="node_modules/vss-web-extension-sdk/lib/VSS.SDK.min.js"></script>
<script src="node_modules/jszip/dist/jszip.min.js"></script>
<script src="dist/app.min.js"></script>
<script type="text/javascript">
// https://stackoverflow.com/a/494348/402706
function createElementFromHTML(htmlString) {
var div = document.createElement('div');
div.innerHTML = htmlString.trim();
return div.firstChild;
}
App.auditWidget(VSS, JSZip, function(renderedApp) {
var widgetNode = document.getElementById('widget');
widgetNode.parentNode.replaceChild(createElementFromHTML(renderedApp), widgetNode);
});
</script>
</body>
</html>