kevva / screenshot-stream

Capture screenshot of a website and return it as a stream
MIT License
236 stars 38 forks source link

Fix ES5-shim insertion issue #12

Closed kevva closed 9 years ago

kevva commented 9 years ago

Page should reload or something without inserting the es5-shim if it fails on the first attempt.

https://github.com/sindresorhus/pageres/issues/136.

sindresorhus commented 9 years ago

@kevva Any thoughts on how we can fix this?

kevva commented 9 years ago

Not any good solutions yet, no.

sindresorhus commented 9 years ago

These seems to be fixed by https://github.com/kevva/screenshot-stream/commit/34410dc2e02ced49afb355bbb27069bf34408ffe

pageres http://www.nationalgeographic.com 320x480 1024x768 1366x768
pageres cnn.com 320x480

This one still throws though:

❯ pageres bbc.co.uk 1000x1000     
ncat(array_slice.call(arguments))
                );

            }

        };

        // 15. If the [[Class]] internal property of Target is "Function", then
        //     a. Let L be the length property of Target minus the length of A.
        //     b. Set the length own property of F to either 0 or L, whichever is
        //       larger.
        // 16. Else set the length own property of F to 0.

        var boundLength = Math.max(0, target.length - args.length);
kevva commented 9 years ago

Is it related to the es5-shim?

Apparently, yes https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L278.

kevva commented 9 years ago

@sindresorhus, should we just read the whole es5-shim file and compare the error output against it? lol.

sindresorhus commented 9 years ago

Sure, better than it not working.