Forum Discussion
Printable notebook in Rise?
Hi MariaG1 I think the download issue is due to the sandbox that Rise places the HTML block in. I had this issue too with an unrelated HTML block, where the end result was a downloadable PDF, but the download was blocked.
I was able to fix this, but it had to be a post publish fix as I need to add the following attribute "allow-downloads" to the sandbox iframe that contained the download.
I did this by finding the iframe with the following properties:
iframe[data-rise-frontend-sandbox]
And then adding the "allow-downloads" attribute.
If you would like to try this, I am sharing my JavaScript file with you. You just need to copy this into the "scormcontent" folder for SCORM, or "content" folder for Web content.
In the index.html file in "scormcontent" or "content", you then need to include the JS file, at the bottom of the index.html file:
<script src="rise-allow-downloads.min.js"></script >
Copy and save the following JS as rise-allow-downloads.min.js
!function(){const e="#app",t="iframe[data-rise-frontend-sandbox]",n=new WeakSet;function o(e){return"IFRAME"===e?.tagName&&e.hasAttribute("data-rise-frontend-sandbox")}function r(e){o(e)&&!n.has(e)&&(n.add(e),e.hasAttribute("sandbox")&&!e.sandbox.contains("allow-downloads")&&e.sandbox.add("allow-downloads"))}function a(e){e.querySelectorAll(t).forEach(r)}function s(e){new MutationObserver(e=>{for(const n of e)for(const e of n.addedNodes)1===e.nodeType&&(o(e)&&r(e),e.querySelectorAll?.(t).forEach(r))}).observe(e,{childList:!0,subtree:!0})}function i(){const t=document.querySelector(e);return!!t&&(a(t),s(t),!0)}function c(){const e=new MutationObserver(()=>{i()&&e.disconnect()});e.observe(document.documentElement,{childList:!0,subtree:!0})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{i()||c()}):i()||c()}();Related Content
- 1 year ago