-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Is your proposal related to a problem?
In a way, yes: I often have multiple R sessions running simultaneously. It would be great to be able to know from the browser tab (i.e., document.title) something about the R process I'm using.
For instance, since I use emacs/ess, the R process buffers are typically named something like *R:1:quux* where quux is the directory it was started from, and 1 is the nth R process buffer started.
With httpgd::hgd_browser(), the browser correctly opens the page, and the browser tab title says simply "httpgd", since that's what it is set to in index.html. I can go into the web-devtools object browser and change the title to something more meaningful to me in a multi-device workspace, such as:
Describe the solution you'd like
Options?
-
Since
src/httpgd_webserver.cpphard-codes that title, I don't know if it's easy to somehow makem_conf.wwwpath"per-instance", so the "index.html" could be a temporary copy of the template. -
All that is required to do this programmatically is to somehow call
document.title = "*R:1:quux*";
Is it possible to send that js to the server?
-
If it's better/easier to "add an endpoint" to the server so that
POSTing the string will change the title (security considerations), perhapshttpgd::hgd_settitle("*R:1:quux*")would allow me to update it more easily (than browser-console editing).
Describe alternatives you've considered
It is currently effective to manually edit the browser page in the web-browser dev console.