Skip to content

Commit c0b7034

Browse files
author
lich2king
committed
blocked domain message
1 parent ff71608 commit c0b7034

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

public/uv/sw.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ self.addEventListener('fetch', (event) => {
8181
blacklist[domainTld] instanceof RegExp &&
8282
blacklist[domainTld].test(domain.slice(0, -domainTld.length))
8383
) {
84-
return new Response(new Blob(), { status: 406 });
84+
return new Response(`
85+
<html><body style="margin:0;display:flex;justify-content:center;align-items:center;height:100vh;background:#000;color:#fff;font-family:sans-serif;flex-direction:column;">
86+
<h1 style="font-size:3em;margin:0.2em 0;">Blocked</h1>
87+
<p style="font-size:1.2em;">Access to this domain is restricted.</p>
88+
</body></html>
89+
`, {
90+
status: 406,
91+
headers: { 'Content-Type': 'text/html' }
92+
});
8593
}
8694

8795
const domainLower = domain.toLowerCase();

0 commit comments

Comments
 (0)