On a Page, I'm trying to pass data that to an html file I'm loading via iframe. The main data I need right now is current user/course data, so passing data from the window.ENV object would be ideal.
Note: I am just an instructor, thus I do not have admin rights.
The pages I load are from a different course, which I use sort of like a repository for shared content. In the URL below, that's the MY_REPO_COURSE_ID.
So, so many things. Here are a few of my attempts...
I'm pretty close, so I hope it's just that I'm missing something obvious. I.e., I just haven't come across the right page in the documentation.
Sorry to bother the board with something I figured I'd be able to solve, and I'd be grateful for any ideas or suggestions.
Also, I came up with a partial solution -- I can get the current courseId by having JS on the iframe page that parses the URL from document.referrer. That's not a perfect solution, but it's helpful in the short-term.
@jason_vermette I saw your post about something similar to this. Did you ever figure out a way to read the parent URL from within the iframed content?
(my document.referrer plan doesn't work on Firefox)
Hi B_D_T,
If I understand correctly you're attempting to pass data from a Canvas page to another page that you've embedded as an iframe. This is a form of cross-site scripting and simply won't be possible in any normal browser, and Canvas will and should block any attempt at doing so regardless of what browser you're using. It's a massive security concern - imagine the data theft and sabotage students or anyone else would be able to do on the system if they were capable of harvesting data from the site via embedded scripts or sending malicious code to the Canvas system via an external site.
I get the need, though. I've struggled with similar issues over the years and I still have some issues that I cannot solve since it's so limited what HTML you can use on a Canvas page (in the HTML editor), which quickly leads one to thinking that building a page externally and embedding it on the page is the best solution. But then you lose all Canvas functionality and there is, to my knowledge, no way to bridge this gap.
Typically, you'd upload JavaScript and CSS to the Theme Editor in Canvas and then there's no limit to what you can achieve on a regular Canvas page. Or, if you're just trying to fetch certain data, you'd send a request via the Canvas API, but both of these approaches require administrative privileges.
Depending what data you're trying to fetch I might be able to help, but I'll need a detailed description of exactly what you're trying to fetch for use on the external page.
Michael
Hi all, With the forthcoming deprecation of Canvas ePortfolios, I'm wondering if anyone's invented an automated way to download and archive ZIP files of all the ePortfolios in Canvas. There doesn't seem to be an exposed API endpoint to trigger the ZIP process, nor to download the resulting file. Has anyone made headway on…
The LTI external tool we develop displays user avatars. These are taken from the LTI NRPS membership container, specifically the picture property for each class member (see the spec). Recently, the avatars for users who haven't uploaded a profile picture are broken. The issue is that the default avatar URL in the picture…
Hello, I'm building a standalone app that integrate with CanvasI) - What are the requirements (and cost if any) for receiving an API developer key issued by Instructure? - Are Instructure-issued keys enabled globally in all Canvas organizations? or will there need to be institution-by-institution enablement? Thanks
Hi everyone, I am seeking some insight into how Canvas LMS handles HTTP errors and how they are reflected in the logs versus the user interface. We are currently observing the following behavior in our environment: Log-only errors: We are seeing 500 (Internal Server Error) and 503 (Service Unavailable) errors recorded in…
I'm currently integrating an LTI tool and attempting to use the Activity.id.history https://canvas.instructure.com/doc/api/file.tools_variable_substitutions.html#activity-id-history variable, but I'm experiencing issues getting it to work properly. What I've Done: Added the Activity.id.history variable to my Developer…