Skip to content
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

broken example: screenshot-fullpage.js #3

Open
pascalpp opened this issue Sep 25, 2017 · 4 comments
Open

broken example: screenshot-fullpage.js #3

pascalpp opened this issue Sep 25, 2017 · 4 comments

Comments

@pascalpp
Copy link

pascalpp commented Sep 25, 2017

at https://try-puppeteer.appspot.com, using example screenshot-fullpage.js

this line fails:

const devices = require('puppeteer/DeviceDescriptors');

error:

Error running your code. ReferenceError: require is not defined
@ebidel
Copy link
Owner

ebidel commented Sep 25, 2017

Thanks for filing. It's a known issue with that sample. I'll see what I can do :)

@sushant-j
Copy link

Any update on this issue?

@ebidel
Copy link
Owner

ebidel commented Feb 19, 2018

No update.

@lusarz
Copy link

lusarz commented Oct 1, 2018

As a workaround it is possible to use:

const DEVICE = {
  'name': 'iPhone 6',
  'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1',
  'viewport': {
    'width': 375,
    'height': 667,
    'deviceScaleFactor': 2,
    'isMobile': true,
    'hasTouch': true,
    'isLandscape': false
  }
};
await page.emulate(DEVICE);

where DEVICE may be replaced with any item from devices array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants