How to specify a firefox identity when calling bokeh.show
<p>I'm using bokeh to do some interactive data analysis. I'm using a separate firefox profile for this work than I do for other browsing, and I would like to be able to have bokeh open a tab with this other identity when I run the script. The general form is </p>

<pre><code>from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.plotting import show 

[analysis setup]

session = push_session(curdoc())
session.show(*args, **kwargs)
</code></pre>

<p>At the moment, <code>args</code> and <code>kwargs</code> only have the grid layout information. Running this script opens a tab in the default firefox instance. I can then open it up with the firefox profile I want by running</p>

<pre><code>$ firefox -P --no-remote ipython --new-tab http://localhost:5006/?bokeh-session-id=xIjdv4HI8MR1xTkWf8iR5fauYKHvp3wDc3Zre5fv444o
</code></pre>

<p>from the command line. From there on out everything works fine, but I'd like to have bokeh open a tab with the new profile without the extra step. The documentation for session.show only tells me that I can specify a tab or a window, but nothing further.</p>

<p>There is a bug fixed in Bokeh <strong>0.12.3</strong>. You can set the browser to use like:</p>

<pre><code>from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.plotting import figure, show

# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]

# create a new plot with a title and axis labels
p = figure(title='simple line example', x_axis_label='x', y_axis_label='y')

# add a line renderer with legend and line thickness
p.line(x, y, legend='Temp.', line_width=2)

# HERE you define the custom browser
# custom_firefox_bg = '/usr/bin/firefox -P ipython --new-tab %s &amp;'
custom_firefox = '/usr/bin/firefox -P ipython --new-tab %s'

session = push_session(curdoc())
session.show(obj=p, browser=custom_firefox)
</code></pre>

<p><code>%s</code> will be replace by the URL. If the command ends with <code>&amp;</code>, then the browser will be opened in the background to not block your Python script.</p>

python firefox bokeh