New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 #331

Closed
sebastianzillessen opened this Issue Jan 30, 2014 · 7 comments

Comments

Projects
None yet
5 participants
@sebastianzillessen

sebastianzillessen commented Jan 30, 2014

Hello,

I want to use your plugin to make a "screenshot" from my mobile device.

We use Cordova 3.1 and we want to take a "Screenshot" of the displayed HTML Application.

On some Android devices (e.g. Nexus 4) the html2Canvas is working great! (Android 4.4 installed)

On an Samsung GT-I9100G (Android 4.1) or on an Samsung GT-S7562 (Android 4.0) I get an error (see below).

html2canvas: Preload starts: finding background-images
html2canvas: Preload: Finding images
html2canvas: Preload: Done.
html2canvas: start: images: 1 / 2 (failed: 0)
html2canvas: start: images: 2 / 2 (failed: 0)
Finished loading images: # 2 (failed: 0)

html2canvas: Renderer: Canvas renderer done - returning canvas obj:2491
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1

Does anyone have an idea, where this could come from and how I could fix this?

@brcontainer

This comment has been minimized.

Contributor

brcontainer commented Jan 30, 2014

This issue sounds like: #183

is likely that the screenshot outweighs the Limete that a image can be drawn on the canvas, you can try the second option (in my answer), see:

#333 (comment)

@sebastianzillessen

This comment has been minimized.

sebastianzillessen commented Jan 30, 2014

Hmm, well, I just capture the screen without any special settings, so the default resolution of the device should be used (as far as I did understand the documentation correctly).

So a shot with 320 x 480 Pixel (or 640 x 960 Pixel for Retina) is already too large for a canvas?

@brcontainer

This comment has been minimized.

Contributor

brcontainer commented Jan 31, 2014

It's not the size of the screen that is the problem, but what matters is the content of the page.
Since each node of your page is designed to drawImage(), if a node has exceeded the size limit then causes the error.

@sebastianzillessen

This comment has been minimized.

sebastianzillessen commented Jan 31, 2014

Hmm, I don't think that this can really be the problem...
First of all, no element is larger then the screen size (on iPhone this is 640 x 960 ).

And the same code works for an Android 4.4 device with a larger screen then the iPhone or the other Android 4.1 devices. So it can't be an issue concerning only the resolution or size of DOM-elements.

Or am I understanding something wrong?

@brcontainer

This comment has been minimized.

Contributor

brcontainer commented Jan 31, 2014

I think you're confused about what I said. But that's okay.

Come to the point:

What is your version of iOS?
What is the line of code error?
It also occurs in safari ios?

@sjamaan

This comment has been minimized.

sjamaan commented Jun 19, 2014

I had the same problem on Cordova (Android); the fix for #183 indeed fixed it for me. However, please note that the latest tag has a build directory which corresponds to an outdated version which does not have this fix. This is also the version that you'll get when using Bower or NPM. So you'll need to build it yourself.

@usmonster

This comment has been minimized.

Contributor

usmonster commented Sep 1, 2014

Does the latest version have this fix now? @sebastianzillessen, can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment