summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-09-30 01:46:39 +0100
committerjao <jao@gnu.org>2025-09-30 01:46:39 +0100
commit1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669 (patch)
tree7c9089f50fff716897645834b6cc4c16b2cdc77d /lib
parentbaea1398986f71054566b1a5a05163d728c580a8 (diff)
downloadelibs-1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669.tar.gz
elibs-1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669.tar.bz2
tiny safari integration
Diffstat (limited to 'lib')
-rw-r--r--lib/doc/jao-mac.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el
index c828507..b9da4ab 100644
--- a/lib/doc/jao-mac.el
+++ b/lib/doc/jao-mac.el
@@ -116,13 +116,22 @@
(jao-mac-run-applescript jao-nnw--current-article-script))
(defun jao-nnw-browse-current-article ()
- (interactive)
"Browse the URL of the current NNW article."
+ (interactive)
(if-let* ((url (jao-nnw-current-article)))
(unless (string-empty-p url)
(browse-url url))
(message "No article selected in NetNewsWire")))
+;;; Safari
+(defun jao-safari-current-url ()
+ (jao-mac-tell-app "Safari" "return URL of current tab of window 1"))
+
+(defun jao-safari-browse-current ()
+ "Browse the URL of the current Safari topmost document."
+ (interactive)
+ (browse-url (jao-safari-current-url)))
+
;;; Firefox
(defvar jao-ffox--current-url-script
(jao-mac-applescript-prepare