I have a simple javascript program that’s acting a little funny. When I try to specify window.innerHeight to be under 100px, my specification is overridden and a value of 100px is used instead.
The code below does not create a 30px high inner-window as might be expected. Instead the window is 100px. The alert similarly reads “100”.
Any idea on how to fix this?
function loadVideo() {
var args = fetchArguments();
iframe = document.createElement("iframe");
iframe.title = "YouTube video player";
iframe.class = "youtube-player";
iframe.type = "text/html";
iframe.width = args["width"];
iframe.height = args["height"];
iframe.src = "http://www.youtube.com/embed/" + args["vid"];
iframe.frameborder="0";
iframe.allowFullScreen;
document.getElementsByTagName("body")[0].appendChild(iframe); // we append the iframe to the document's body
window.innerHeight= 30; //args["height"];
window.innerWidth=args["width"];
alert(window.innerHeight);
self.focus();
}
Firefox won’t let you create a window of less than 100 pixels in height or width. This is a security restriction.