0

I have extension in which I set height for extension iframe and it works nice in Chrome.

But I have a problem in Safari 9.1.2. Safari is ignoring set height and expand iframe to full browser height.

<iframe id="tools" src="safari-extension://.../tools.html" style="height: 400px !important;">
  #document
    <html>
      ...
    </html>
</iframe>

I set height for iframe by JavaScript:

tools.style.setProperty("height", request.height + "px", "important");

or

tools.style.height(request.height + "px");

and it doesn't work. What am I doing wrong?

Grinv
  • 1
  • 4

1 Answers1

0
document.getElementById("tools").style.height = "50px"

^ correct syntax

tools.style.height = request.height + "px";

or

tools.style.height = request.height;

should do the trick.

depending on the value of request.height

Bucky208
  • 76
  • 1
  • 10
  • I created iframe element before as: `tools = document.createElement("iframe");` I mean it doesn't work with dynamically variable and constant. I think that this is due to the features of Safari work. – Grinv Jun 07 '16 at 14:17
  • @Grinv, is this on your desktop er mobile device? – Bucky208 Jun 07 '16 at 14:34
  • on Desktop. Safari 9.1.2. – Grinv Jun 07 '16 at 14:46
  • http://stackoverflow.com/questions/5867985/full-screen-iframe-with-a-height-of-100 Maybe one of these guys found a solution. – Bucky208 Jun 08 '16 at 13:00