extension: first cut at background.js.html

This commit is contained in:
Omar Rizwan 2021-03-21 11:55:52 -07:00
parent 11cf48259a
commit 57726b4354
1 changed files with 17 additions and 0 deletions

View File

@ -585,6 +585,23 @@ router["/runtime/reload"] = {
},
truncate() { return {}; }
};
router["/runtime/background.js.html"] = defineFile(async path => {
const js = await window.fetch(chrome.runtime.getURL('background.js'))
.then(r => r.text());
return `
<html>
<body>
<dl>
${Object.entries(router).map(([a, b]) => `
<dt>${a}</dt>
<dd>${b}</dd>
`).join('\n')}
</dl>
<pre><code>${js}</code></pre>
</body>
</html>
`;
});
// Ensure that there are routes for all ancestors. This algorithm is
// probably not correct, but whatever. Basically, you need to start at