Fork me on GitHub
#portal
<
2024-03-04
>
J10:03:11

Hi guys! I have two computers with different behaviour when I open portal. One open a chrome window and the other open a tab in firefox. Did you know how to setup the open in the browser?

👍 1
mschmele15:03:15

Opening in the browser is (I believe) the default behavior, so whatever you're using to launch portal is likely specifying that it should launch in another window. Do you know where you're calling (portal.api/open)?

mschmele15:03:42

Oh I'm looking more closely at your question and just realizing that you just have to pick your default browser, which is an OS-level setting

mschmele15:03:02

(assuming that you want to specify whether portal opens in chrome or firefox)

J15:03:32

The two computers are firefox has default browser (macos) but one open a chrome window (as an electron app)

mschmele15:03:02

Oh, that is unexpected! Can you paste in the lines from your emacs.d/ that open portal? Maybe it's hidden in there

djblue16:03:56

If you want to prevent using chrome's app mode, you can opt-out via (portal.api/open {:app false})

J16:03:25

@U24FM0Y3U here my config about portal in emacs:

;;
;; PORTAL CONFIGURATION
;;

(defun portal.api/open ()
  (interactive)
  (cider-nrepl-sync-request:eval
    "(do (ns dev) (def portal ((requiring-resolve 'portal.api/open))) (add-tap (requiring-resolve 'portal.api/submit)))"))

(defun portal.api/clear ()
  (interactive)
  (cider-nrepl-sync-request:eval "(portal.api/clear)"))

(defun portal.api/close ()
  (interactive)
  (cider-nrepl-sync-request:eval "(portal.api/close)"))
@U1G869VNV I will try that

👍 1
djblue16:03:34

You can also set this up as a default via (portal.api/set-defaults! {:app false})

👍 1
mschmele16:03:17

The cavalry! Thanks Chris 🙂

💯 1
djblue16:03:11

My assumption for the difference of behavior is that your machine that uses firefox by default doesn't have chrome installed.

plus_one 1
J16:03:00

Thanks guys for your time! @U1G869VNV you are right!