8000 The `:browser` feature doesn't work when `browse-url-handlers` is defined · Issue #72 · hrs/engine-mode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content < 8000 span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
The :browser feature doesn't work when browse-url-handlers is defined #72
Open
@MinasMazar

Description

@MinasMazar

I've configured this engine:

    (setq engine/browser-function #'browse-url-firefox)
    (defengine duckduckgo
      "https://duckduckgo.com/?q=%s"
      :browser 'eww-browse-url
      :keybinding "d")

I guess the expected behavior is to open the duckduckgo URL with EWW, and all other engines's URLs with Firefox, but is not what I'm experiencing (some engines are using EW 5A0A W, some are using Chrome, some Firefox..) I then found that engine/execute-search uses browse-url; looking into this function I see

	(function (or (browse-url-select-handler url)
                      browse-url-browser-function))

So the :browser feature in engine-mode will work until the browse-url-handlers is nil. Is this the expected behavior? If so, can we make more explicit in the documentation? Otherwise, this patch in the engine/execute/search fixes the issue.

  (defun engine/execute-search (search-engine-url browser-function search-term)
  "Display the results of the query."
  (interactive)
  (let ((browse-url-handlers nil) ;; <-- THIS IS THE FIX
	(browse-url-browser-function browser-function))
    (browse-url
     (format-spec search-engine-url
                  (format-spec-make ?s (url-hexify-string search-term))))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0