Skip to content

Commit

Permalink
mode/bookmarklets: Properly parse javascript: scheme bookmarklets.
Browse files Browse the repository at this point in the history
  • Loading branch information
aartaka committed Sep 19, 2022
1 parent 781cfd0 commit a79a874
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/mode/bookmarklets.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ By default, this mode does nothing but expose the default bookmarklets."
`(let* ((source ,source)
(source (etypecase source
(pathname (nfiles:content (make-instance 'nfiles:file :base-path source)))
(string source))))
(string source)))
(source (if (str:starts-with-p "javascript:" source)
(or (ignore-errors (quri:url-decode (quri:uri-path (quri:uri source))))
(subseq source 11))
source)))
(ffi-buffer-evaluate-javascript-async buffer source))))
(export 'define-bookmarklet-command)
(defmacro define-bookmarklet-command (name documentation source)
Expand Down

0 comments on commit a79a874

Please sign in to comment.