plot icon indicating copy to clipboard operation
plot copied to clipboard

is there a way to not launch a new browser process for each new graph?

Open slyrus opened this issue 3 years ago • 8 comments

Using plot (which defaults to chrome, and I can't seem to make firefox work, but that's another problem), every time I create a plot, it launches a new Chrome process. This wouldn't be so horrible if Chrome didn't think it was a brand new install every time it launches, asking me if I want Chrome to be my default browser and if I want to send data to google, neither of which I want. Any way to make the default be opening a new window in, say, firefox? Or, at a minimum, using an existing chrome process?

slyrus avatar Sep 06 '22 01:09 slyrus

I want this too, and there is some work in progress to use a webview.h browser and websocket so that a single browser window will handle all plots. There is someone with a working prototype, but I haven't haven't had a lot of time for this lately.

There are reports of firefox working. Try setting the default browser in PLOT:SRC;PLOT;browser. You can also configure options there. FWIW: my Chrome doesn't ask me about defaults, sending data, etc. In order to remove the menus and tabs we need to have a new configuration directory (user-data-directory) for Chrome with each plot in a temp directory. It could be that on your OS this makes Chrome think it's a new install. Try unsetting this in encode-chrome-options.

snunez1 avatar Sep 06 '22 01:09 snunez1

Clearly R(?) has figured out the correct incantion for firefox as evaluating various table generating forms at the R repl exhibit the behavior I'm looking for.

slyrus avatar Sep 06 '22 03:09 slyrus

@slyrus, does @tobyWorland commit solve the issue for you?

Symbolics avatar Oct 23 '22 03:10 Symbolics

@Symbolics good question but first I have to get cephes to build :(

slyrus avatar Oct 23 '22 22:10 slyrus

FWIW, using the latest cephes from github solves the building on MacOS problem.

slyrus avatar Oct 23 '22 22:10 slyrus

@Symbolics it's better. I'd still rather see a new tab open than a new window (and maybe without the GUI notification of launching a new process showing up in the dock). And it doesn't seem to work on firefox. A new window opens, but nothing is in it (other than the default stuff). So, progress, but not there yet.

slyrus avatar Oct 24 '22 00:10 slyrus

My access to MacOS is limited, and I won't be able to help with the MacOS/Firefox problem. If you have the bandwidth, I'd appreciate someone looking into this. Alternatively, the webview.h plot view viewer is progressing and would love some help. That would solve all these issues, on all platforms.

Symbolics avatar Oct 24 '22 01:10 Symbolics

...rather see a new tab open than a new window...

@slyrus You just want a tab to open in your regular browser? As long as Firefox is set as your default browser (setf plot:*default-browser-command* :default) should have it open in a new tab instead. I don't have a mac to test, but I see no reason why it shouldn't work.

Perhaps a variable should be added to control whether a toolbarless browser should be used or the user's regular one.

tobyWorland avatar Oct 24 '22 11:10 tobyWorland

@slyrus, is this working for you? Can we close the issue?

snunez1 avatar Dec 27 '22 12:12 snunez1

@slyrus, I'm going to close this as fixed now. If you encounter problems, please open another issue, or reopen this one.

Symbolics avatar Jan 21 '23 01:01 Symbolics