<img alt="Snippet of the Wikipedia page for 'Bitcoin' but all instances of the word 'bitcoin' are replaced with 'buttcoin'." src="./buttcoin.png">
+## eruda
+
+This reverse proxy injects [eruda](https://github.com/liriliri/eruda) into a
+webpage. Good for quickly injecting DevTools into a webpage.
+
+```
+https://x.y.workers.dev?https://example.com
+```
+
<h1 align="center">Web Utilities</h1>
## qr
--- /dev/null
+class InjectEruda {
+ element(element) {
+ element.prepend('<script src="//cdn.jsdelivr.net/npm/eruda"></script><script>eruda.init();</script>', { html: true });
+ }
+}
+
+export default {
+ async fetch(request) {
+ const url = /^http(s)?:\/\//i.test(request.url) ? new URL(request.url) : new URL(`https://${request.url}`);
+ const queryString = decodeURIComponent(url.search.substring(1));
+
+ const response = await fetch(queryString);
+ return new HTMLRewriter().on('body', new InjectEruda()).transform(response);
+ }
+}
--- /dev/null
+{
+ "name": "eruda",
+ "version": "0.3.0",
+ "description": "Reverse proxy which injects eruda into a webpage.",
+ "license": "ISC",
+ "author": "Ardis Lu",
+ "private": true,
+ "scripts": {
+ "dev": "wrangler dev",
+ "deploy": "wrangler deploy"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/ardislu/cloudflare-workers.git"
+ }
+}
--- /dev/null
+name = 'eruda'
+main = 'index.js'
+compatibility_date = '2023-06-26'
+route = { pattern = 'eruda.example.com', custom_domain = true }
"style",
"unroll",
"buttcoin",
- "archive"
+ "archive",
+ "eruda"
]
}