1.2.0 permalink Arrow_down_16x16

open-url-in-browser

clojure.contrib.javadoc.browse

  • (open-url-in-browser url)
Opens url (a string) in the default system web browser. May not
work on all platforms. Returns url on success, nil if not
supported.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/javadoc/browse.clj:26 top

(defn open-url-in-browser
  "Opens url (a string) in the default system web browser.  May not
  work on all platforms.  Returns url on success, nil if not
  supported."
  [url]
  (try 
    (when (clojure.lang.Reflector/invokeStaticMethod "java.awt.Desktop" 
      "isDesktopSupported" (to-array nil))
      (-> (clojure.lang.Reflector/invokeStaticMethod "java.awt.Desktop" 
            "getDesktop" (to-array nil))
        (.browse (URI. url)))
      url)
    (catch ClassNotFoundException e
      nil)))
Vars in clojure.contrib.javadoc.browse/open-url-in-browser: -> defn to-array when
Used in 0 other vars

Comments top

No comments for open-url-in-browser. Log in to add a comment.