-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebR chunks not working with Safari browser #21
Comments
At first glance, this looks like #8 (comment) since Bob is using an iframe trick to embed the code area inside of a slide deck (not 100% supported at the moment, c.f. #14). Chrome uses "credentialless" iframes that other browsers are working toward adopting, c.f. mozilla/standards-positions#628 and Apples' WebKit. |
Ran into the same Safari issue previously when trying out WebR chunks in a Quarto book (https://danieleweeks.github.io/HuGen2071/webR_test.html), but thought maybe that was because GitHub.io might not yet allow Cross-Origin-Resource-Policy headers. But it also doesn't work at https://hugen2071.netlify.app/webr_test where I think I have implemented the headers correctly. The code for the example "WebR - R in the web browser" chapter is simple (https://github.com/DanielEWeeks/HuGen2071/blob/main/webR_test.qmd) with no iframe tricks:
|
Hmm, that's a perfect MWE! Glancing at the inside from Safari, I'm seeing: From the output, Safari is unhappy with the Monaco editor that should display the code. We switched from CodeMirror over to Monaco in 0.2.0 to potentially solve the re-scaling issue with Maybe a quick fix for you would be to revert back to v0.1.0 (last version of CodeMirror) by running in the Terminal tab of RStudio: quarto add coatless/[email protected] Switching back to the problem at hand... I was able to replicate this problem, but with just a refresh the code cell simply "works" as shown in the following GIF: As a result, two things come to my mind:
"ResizeObserver loop completed with undelivered notifications."
"Failed to load resource: the server responded with a status of 404 ()" One of the odd things is if you refresh the page in Safari, it loads the Monaco editor. @jooyoungseo have you ever experienced any of these issues with Monaco? |
@coatless -- I have no idea off the top of my head. Maybe, we can try with the latest Monaco, 0.39.0. I used v0.31.0. If we upgrade it to the latest Monaco, the code cell execution keybindings (Shift+Enter, Ctrl+Enter) may not work and we need to fix that later. |
@jooyoungseo No worries. I'll spend some time debugging further if the Monaco upgrade doesn't address the reload requirement. Glancing at the Monaco page, let's aim to use Monaco at 0.40.0 instead of 0.39.0. |
@coatless Awesome! Thanks! I will test the accessibility again once you upgrade Monaco to 0.40.0. :) |
Just verifying that reverting back, as suggested, to v0.1.0 (last version of CodeMirror) makes the WebR chunk on this web page https://danieleweeks.github.io/HuGen2071/webR_test.html work perfectly within the Safari browser. Thank you! |
…he load steps for MonacoEditor The `loader.js` and `require.config()` initialization is set to happen at the top of the document's <body> instead of the <head>.
…he load steps for MonacoEditor The `loader.js` and `require.config()` initialization is set to happen at the top of the document's <body> instead of the <head>.
* Ignore a few files that are generated from tests. * Update the MonacoEditor to v0.43.0 from v0.31.0 * Fix WebR chunks not working with Safari browser #21 by re-arranging the load steps for MonacoEditor The `loader.js` and `require.config()` initialization is set to happen at the top of the document's <body> instead of the <head>. * Fix #28 by re-registering keyboard shortcuts. * Bump extension version to 0.3.2
@DanielEWeeks should be fixed now. Feel free to use: quarto add coatless/[email protected] |
Having WebR interactive R chunks in a Quarto document is so very wonderful!
However, I'm wondering if you might have any insight/comments on why those chunks don't work in the Safari browser?
For a detailed example, see this issue:
hrbrmstr/2023-nyr-webr#1
Thank you,
Dan Weeks
The text was updated successfully, but these errors were encountered: