Broken project to implement a cross-protocol browser in textual
protocol: add about uri scheme
Zach DeCook 2023-01-19
parent dd3051a · commit 7682658
-rwxr-xr-xbrowset.py2
-rw-r--r--protocol/about.py10
2 files changed, 12 insertions, 0 deletions
diff --git a/browset.py b/browset.py
index c8e3300..ad4bc13 100755
--- a/browset.py
+++ b/browset.py
@@ -10,12 +10,14 @@ from mime.highlightedcode import HighlightedCode,mimetolexer
from protocol.gemini import GeminiProtocol
from protocol.data import DataProtocol
from protocol.http import HttpProtocol
+from protocol.about import AboutProtocol
protocols = {
"gemini": GeminiProtocol,
"data": DataProtocol,
"http": HttpProtocol,
"https": HttpProtocol,
+ "about": AboutProtocol,
}
class Browset(App):
diff --git a/protocol/about.py b/protocol/about.py
new file mode 100644
index 0000000..cc308f9
--- /dev/null
+++ b/protocol/about.py
@@ -0,0 +1,10 @@
+class AboutProtocol():
+ def get(url):
+ page = url.split(':')[1]
+ if page == 'about':
+ return ('text/gemini', [
+ '=>about:about\n',
+ '=>about:blank\n',
+ ])
+ elif page == 'blank':
+ return ('text/plain',[])