portal

J 2024-03-04T10:47:11.855999Z

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
mschmele 2024-03-04T15:29:15.344879Z

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)?

J 2024-03-04T15:31:23.833239Z

I use this for the two computers: https://cljdoc.org/d/djblue/portal/0.52.2/doc/editors/emacs

mschmele 2024-03-04T15:32:42.912779Z

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

mschmele 2024-03-04T15:33:02.626789Z

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

J 2024-03-04T15:38:32.930869Z

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

mschmele 2024-03-04T15:58:02.668129Z

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

djblue 2024-03-04T16:07:56.654239Z

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

J 2024-03-04T16:09:25.577049Z

@mschmele 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)"))
@djblue I will try that

👍 1
djblue 2024-03-04T16:09:34.291099Z

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

👍 1
mschmele 2024-03-04T16:10:17.150889Z

The cavalry! Thanks Chris 🙂

💯 1
djblue 2024-03-04T16:12:11.327109Z

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

1
J 2024-03-04T16:13:00.341769Z

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