Ability to Set iFrame Height Via Post Message

Idea created by Daniel William Slusser on May 30, 2019
    Open for Voting

    The LTI API has a small but mighty feature that I would like to be able to extend to my iframed HTML files.


    LTI's have the ability via javascript to post a message to Canvas that contains a height variable. Canvas receives this post message and uses the height variable to set the iframe height of the LTI.


    I would like to be able to take advantage of this same post message in my HTML files so that I can set a specific iframe height of an HTML file. Setting the height of an HTML file can be done using the Canvas HTML editor, but I find that teachers often get the height incorrect when they are asked to iframe HTML files; leaving scroll bars all over the place and this leads to poor user experience. Having this feature can take the guesswork out of the equation for the teachers and allow Instructional Designers to create better continuity throughout courses. 


    I also believe (though not confirmed) that having this feature will allow for the ability of the height of the iframe to be responsive; similar to how setting the width of an iframe to 100% has a responsive-like effect to iframes.


    The feature would look similar to how the LTI post message was implemented. The github commit for the LTI post message was completed back in 2014. The commit can be seen here:  https://github.com/instructure/canvas-lms/commit/834aba7d2e412daefb47771ebe294426366ad36f