In my app I have a button to dynamically generate a report and open that report in a new browser window. This worked well locally but failed in
shinyapps.io. The error log is as follows:
2017-10-06T14:18:52.605039+00:00 shinyapps[182623]: [2017-10-06 14:18:52] Work Report Generated
2017-10-06T14:18:53.131335+00:00 shinyapps[182623]: Couldn't find a suitable web browser!
2017-10-06T14:18:53.131338+00:00 shinyapps[182623]: Set the BROWSER environment variable to your desired browser.
2017-10-06T14:18:53.131465+00:00 shinyapps[182623]: Warning: program returned non-zero exit code #1
2017-10-06T14:18:53.151372+00:00 shinyapps[182623]: WARNING: You don't seem to have any mimeinfo.cache files.
2017-10-06T14:18:53.151373+00:00 shinyapps[182623]: Try running the update-desktop-database command. If you
2017-10-06T14:18:53.151374+00:00 shinyapps[182623]: don't have this command you should install the
2017-10-06T14:18:53.151375+00:00 shinyapps[182623]: desktop-file-utils package. This package is available from
2017-10-06T14:18:53.151376+00:00 shinyapps[182623]: http://freedesktop.org/wiki/Software_2fdesktop_2dfile_2dutils
2017-10-06T14:18:53.175550+00:00 shinyapps[182623]: Can't call method "get_value" on an undefined value at /usr/bin/mimeopen line 162.
2017-10-06T14:18:53.176838+00:00 shinyapps[182623]: /usr/bin/xdg-open: 461: /usr/bin/xdg-open: links2: not found
2017-10-06T14:18:53.177080+00:00 shinyapps[182623]: /usr/bin/xdg-open: 461: /usr/bin/xdg-open: links: not found
2017-10-06T14:18:53.177298+00:00 shinyapps[182623]: /usr/bin/xdg-open: 461: /usr/bin/xdg-open: lynx: not found
2017-10-06T14:18:53.177532+00:00 shinyapps[182623]: /usr/bin/xdg-open: 461: /usr/bin/xdg-open: w3m: not found
2017-10-06T14:18:53.177548+00:00 shinyapps[182623]: xdg-open: no method available for opening '/tmp/RtmpbZwdGq/1c9d17a374b32b22f823db7827f4f2ab/Report_2017-10-06_14-18-17/report.html'
It seemed that `xdg-open` is not installed in server. However I'm also not sure if this will work as intended: even if `xdg-open` is installed, I doubt the server will open a new browser window for user.
If this is not gonna work, another alternatives is that I can create a link in app. User can click the link to open the file. However,
1. Since the file is dynamically updated at the time of clicking, user need to first to click a button to update the file, then click the click.
2. I cannot use `file://` url, because
Note that when pages are loaded with a HTTP(S) protocol (the case of the Shiny app) for security reasons you can't framed locals files with their "file:" URLs. If you want to display locals pdf you should access to them with a http(s): URL, so you have to save them in your www directory (a local web server) and access to files with their http(s): URLs
So that's a lot of work and user still need to click twice.