javascript - Resizing a hidden-frame -
I am trying to load a webpage in a hidden frame (SDK / frame / hidden frame) and then a screenshot of it I can just get right screenshot I, but the frame has been provided using the following code is not properly sized screenshots
var hiddenFrames = require ( "sdk / frame / Hidden-frame "); The hidden hidden hidden Frems.ad (hidden Fremkhaidedfrem ({onReady: function () {this.element.contentWindow.location = "http://example.com"; to themselves; this.element.addEventListener ( "DOMContentLoaded", function () {var cnvs = self.element.contentDocument.createElement ( "canvas"); var width = self.element.contentDocument.body.clientHeight; // client.Width 0 is www for some reason. example.com = Self.element.contentDocument.body.clientHeight for var height; cnvs.width = width; cnvs.height = height; var ctx = cnvs.getContext ( "2d"); console.log (width + "+ height "); ctx.drawWindow (Self.element.contentWindow, 0, 0, width, height," rgb (255,255,255) "; console.log (cnvs.toDataURL ());}, true, true);}}) );
I widened the iframe E and height have been attempted
this.element.width = "1600"; This.element.height = "900";
Changing the size of the element.contentWindow
with resizeTo ()
, and changing the shape of the body. None of them have an effect on the final screenshot, which looks
$ ('iframe'). Load (function () {$ (this) .css ({width: 1600, height: 900});});
Comments
Post a Comment