about summary refs log tree commit diff stats
path: root/src/html/env.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-01-02 21:19:46 +0100
committerbptato <nincsnevem662@gmail.com>2023-01-02 21:19:46 +0100
commit62983cdc609aacc47ade0a8a4a4c6b85dd26199a (patch)
treeab0518ac0f556a499107887fb524beddb80ba104 /src/html/env.nim
parentf2bf1572456412f109d06c6a49e34cfbe924bbfa (diff)
downloadchawan-62983cdc609aacc47ade0a8a4a4c6b85dd26199a.tar.gz
dom: add better attribute reflection
Instead of creating a new function for each attribute, use a single
magic function for reflected attributes.
Diffstat (limited to 'src/html/env.nim')
-rw-r--r--src/html/env.nim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/html/env.nim b/src/html/env.nim
index 3c1668c7..a232baa5 100644
--- a/src/html/env.nim
+++ b/src/html/env.nim
@@ -22,13 +22,14 @@ proc language(navigator: Navigator): string {.jsfget.} = "en-US"
 proc languages(navigator: Navigator): seq[string] {.jsfget.} = @["en-US"] #TODO frozen array?
 
 # NavigatorOnline
-proc onLine(navigator: Navigator): bool {.jsfget.} = true # none of your business :)
+proc onLine(navigator: Navigator): bool {.jsfget.} =
+  true # at the very least, the terminal is on-line :)
 
 #TODO NavigatorContentUtils
 
 # NavigatorCookies
 # "this website needs cookies to be enabled to function correctly"
-# I'll take your incorrectly functioning website over the tracking any day.
+# It's probably better to lie here.
 proc cookieEnabled(navigator: Navigator): bool {.jsfget.} = true
 
 # NavigatorPlugins
@@ -48,9 +49,6 @@ proc addNavigatorModule(ctx: JSContext) =
   ctx.registerType(PluginArray)
   ctx.registerType(MimeTypeArray)
 
-#func `$`(window: Window): string {.jsfunc.} =
-#  "[object Window]"
-
 proc newWindow*(scripting: bool, loader = none(FileLoader)): Window =
   result = Window(
     console: console(),