Function: shr-probe-url

shr-probe-url is an interactive and byte-compiled function defined in shr.el.gz.

Signature

(shr-probe-url URL CONT)

Documentation

Pass URL's redirect destination to CONT, if it has one.

CONT should be a function of one argument, the redirect destination URL. If URL is not redirected, then CONT is never called.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-probe-url (url cont)
  "Pass URL's redirect destination to CONT, if it has one.
CONT should be a function of one argument, the redirect
destination URL.  If URL is not redirected, then CONT is never
called."
  (interactive "P")
  (url-retrieve
   url (lambda (a)
         (pcase a
           (`(:redirect ,destination . ,_)
            ;; Remove common tracking junk from the URL.
            (funcall cont (replace-regexp-in-string
                           ".utm_.*" "" destination)))))
   nil t t))