webview-get-style debugging
This commit is contained in:
+18
-15
@@ -1040,26 +1040,29 @@
|
||||
))
|
||||
(r (webview-call-js wv js-code))
|
||||
)
|
||||
; (format
|
||||
; (js-code
|
||||
; "function(id, el) {"
|
||||
; " let cl = ~a;"
|
||||
; " let r = {};"
|
||||
; " cl.forEach(function(st) {"
|
||||
; " let stl = window.getComputedStyle(el);"
|
||||
; " r[st] = stl[st];"
|
||||
; " });"
|
||||
; " return { id: id, style: r };"
|
||||
; "}") cl))
|
||||
; )))
|
||||
; (format
|
||||
; (js-code
|
||||
; "function(id, el) {"
|
||||
; " let cl = ~a;"
|
||||
; " let r = {};"
|
||||
; " cl.forEach(function(st) {"
|
||||
; " let stl = window.getComputedStyle(el);"
|
||||
; " r[st] = stl[st];"
|
||||
; " });"
|
||||
; " return { id: id, style: r };"
|
||||
; "}") cl))
|
||||
; )))
|
||||
(displayln (format "~a: ~a" r js-code))
|
||||
(if (eq? r #f)
|
||||
#f
|
||||
(let ((h (hash-ref r 'with-ids)))
|
||||
(let ((l (map (λ (e)
|
||||
(cons
|
||||
(string->symbol (hash-ref e 'id))
|
||||
(hash-ref e 'style))) h)))
|
||||
(let ((id-rec (car e))
|
||||
(style-rec (cadr e)))
|
||||
(cons (string->symbol (cadr id-rec))
|
||||
(make-hash (map (λ (e) (cons (car e) (cadr e))) (cadr style-rec)))
|
||||
)
|
||||
)) h)))
|
||||
(if (symbol? selector)
|
||||
(cdr (car l))
|
||||
l))))
|
||||
|
||||
Reference in New Issue
Block a user