Comments (4)
That is an interesting issue. I thought for a while but I don't know what to do in this case. I cannot simply disable the websocket in the iframe, since RStudio viewer is essentially an iframe.
from servr.
True. I realize this is a bit of an edge case. It's probably a reasonable expectation for users to want to use iframes but in many cases it might point to something served from somewhere else, in which case this wouldn't be an issue (right?).
For my case, I have a master page allows the user to page through other pages created through servr, embedded in iframes (see here: http://ryanhafen.com/blog/rmote). The updating behavior isn't consistent (sometimes the iframe updates, sometimes the index).
I wonder how easy / reasonable it would be to add a check in the websockets javascript for a variable that indicates not to connect. I could then explicitly set the variable in the pages I don't want the script to be applied to. What do you think?
from servr.
Okay, now you can use an HTML comment <!-- DISABLE-SERVR-WEBSOCKET -->
to disable the websocket on an HTML page, e.g.
library(servr)
library(htmltools)
tmpd <- tempdir()
httw(dir = tmpd, daemon = TRUE, pattern = "index.html")
save_html(HTML("iframecontent <!-- DISABLE-SERVR-WEBSOCKET -->"), file = file.path(tmpd, "iframe.html"))
save_html(tagList(tags$p("test1"), tags$iframe(src = "iframe.html")),
file = file.path(tmpd, "index.html"))
from servr.
Perfect! Thanks for considering this case. I can verify that it has provided me a way to fix my issue.
from servr.
Related Issues (20)
- installation error (Mutex creation failed) on manjaro/arch linux HOT 3
- nginx and initpath and baseurl, oh my HOT 2
- URLs on RStudio Server HOT 1
- superfluous warning from random_port HOT 1
- View server logs? HOT 1
- servr does not reclaim daemonised servers after deamon_stop() HOT 1
- "auto_ptr" deprecation warning on installation HOT 4
- single quote doesn't work for Rscript on Windows 10 HOT 5
- servr::rmdv2 is blocking ? HOT 1
- Malformed Accept-Ranges Header
- Could we set the files being rendered with rmdv2 ? HOT 1
- How to run server inside docker HOT 13
- Use Perl-like regex for file matching HOT 1
- Start a server without launching browser HOT 7
- Unsafe ports list needs to be updated
- Periodic refresh HOT 1
- How to use handler? HOT 1
- inf_mr() opening new instances when saving .Rmd file in R Studio HOT 3
- Unicode not working in inf_mr() HOT 3
- Authentication HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servr.