display delay inside iframe
Posted: Thu Aug 11, 2011 7:21 pm
I'm a web developer who uses noscript. I ran across a side-effect of noscript that I feel I should point out.
When you load a page with blocked items (a flash file in this case), noscript starts by not displaying them, then after the page loads, it inserts a box where that item should be, allowing you to run them.
The problem arises when using scrollHeight to get the height of the page inside the onload event. Firefox reports an incorrect height in this case, since onload runs before noscript displays the box. This is a problem when you are resizing an iframe's height to fit its content. It probably causes trouble in other circumstances also.
Would it be possible to change noscript to use visibility:hidden instead of display:none in the cases when it will be displaying a box later? I'm not really familiar with the internals of noscript, so wouldn't be surprised if this is not possible.
When you load a page with blocked items (a flash file in this case), noscript starts by not displaying them, then after the page loads, it inserts a box where that item should be, allowing you to run them.
The problem arises when using scrollHeight to get the height of the page inside the onload event. Firefox reports an incorrect height in this case, since onload runs before noscript displays the box. This is a problem when you are resizing an iframe's height to fit its content. It probably causes trouble in other circumstances also.
Would it be possible to change noscript to use visibility:hidden instead of display:none in the cases when it will be displaying a box later? I'm not really familiar with the internals of noscript, so wouldn't be surprised if this is not possible.