Add dedicated reader page

This commit is contained in:
Oliver Blanthorn 2023-04-05 19:19:05 +02:00
parent 569b01a607
commit 5bec833bb6
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 25 additions and 1 deletions

View file

@ -1,6 +1,6 @@
const esbuild = require('esbuild') const esbuild = require('esbuild')
for (let f of ["content", "background", "help", "newtab", "commandline_frame"]) { for (let f of ["content", "background", "help", "newtab", "reader", "commandline_frame"]) {
esbuild.build({ esbuild.build({
entryPoints: [`src/${f}.ts`], entryPoints: [`src/${f}.ts`],
bundle: true, bundle: true,

9
src/reader.ts Normal file
View file

@ -0,0 +1,9 @@
// import * as config from "@src/lib/config"
function updatePage(){
const dodgyhtml = atob(window.location.hash.substr(1))
document.body.innerHTML = dodgyhtml
}
window.addEventListener("load", updatePage)
window.addEventListener("hashchange", updatePage)

15
src/static/reader.html Normal file
View file

@ -0,0 +1,15 @@
<!doctype html>
<html lang="en" class="TridactylOwnNamespace">
<head>
<meta charset="utf-8">
<title>&nbsp;</title>
<link rel="stylesheet" href="css/reader.css">
<link rel="stylesheet" href="css/content.css">
<link rel="stylesheet" href="css/hint.css">
<link rel="stylesheet" href="css/viewsource.css">
</head>
<body>
</body>
<script src="../content.js"></script>
<script src="../reader.js"></script>
</html>