mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
6.0 KiB
JavaScript
2 lines
6.0 KiB
JavaScript
/*! For license information please see 445edf82.6ced89d5.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[36872],{81905:(e,n,a)=>{a.r(n),a.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>p});var i=a(85893),o=a(11151);const s={sidebar_label:"KnownDevices"},l="KnownDevices variable",r={id:"api/puppeteer.knowndevices",title:"KnownDevices variable",description:"A list of devices to be used with Page.emulate().",source:"@site/versioned_docs/version-22.8.2/api/puppeteer.knowndevices.md",sourceDirName:"api",slug:"/api/puppeteer.knowndevices",permalink:"/api/puppeteer.knowndevices",draft:!1,unlisted:!1,tags:[],version:"22.8.2",frontMatter:{sidebar_label:"KnownDevices"},sidebar:"api",previous:{title:"KeyPressOptions",permalink:"/api/puppeteer.keypressoptions"},next:{title:"launch",permalink:"/api/puppeteer.launch"}},c={},p=[{value:"Signature:",id:"signature",level:4},{value:"Example",id:"example",level:2}];function t(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"knowndevices-variable",children:"KnownDevices variable"}),"\n",(0,i.jsxs)(n.p,{children:["A list of devices to be used with ",(0,i.jsx)(n.a,{href:"/api/puppeteer.page.emulate",children:"Page.emulate()"}),"."]}),"\n",(0,i.jsx)(n.h4,{id:"signature",children:"Signature:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:"KnownDevices: Readonly<\n Record<\n | 'Blackberry PlayBook'\n | 'Blackberry PlayBook landscape'\n | 'BlackBerry Z30'\n | 'BlackBerry Z30 landscape'\n | 'Galaxy Note 3'\n | 'Galaxy Note 3 landscape'\n | 'Galaxy Note II'\n | 'Galaxy Note II landscape'\n | 'Galaxy S III'\n | 'Galaxy S III landscape'\n | 'Galaxy S5'\n | 'Galaxy S5 landscape'\n | 'Galaxy S8'\n | 'Galaxy S8 landscape'\n | 'Galaxy S9+'\n | 'Galaxy S9+ landscape'\n | 'Galaxy Tab S4'\n | 'Galaxy Tab S4 landscape'\n | 'iPad'\n | 'iPad landscape'\n | 'iPad (gen 6)'\n | 'iPad (gen 6) landscape'\n | 'iPad (gen 7)'\n | 'iPad (gen 7) landscape'\n | 'iPad Mini'\n | 'iPad Mini landscape'\n | 'iPad Pro'\n | 'iPad Pro landscape'\n | 'iPad Pro 11'\n | 'iPad Pro 11 landscape'\n | 'iPhone 4'\n | 'iPhone 4 landscape'\n | 'iPhone 5'\n | 'iPhone 5 landscape'\n | 'iPhone 6'\n | 'iPhone 6 landscape'\n | 'iPhone 6 Plus'\n | 'iPhone 6 Plus landscape'\n | 'iPhone 7'\n | 'iPhone 7 landscape'\n | 'iPhone 7 Plus'\n | 'iPhone 7 Plus landscape'\n | 'iPhone 8'\n | 'iPhone 8 landscape'\n | 'iPhone 8 Plus'\n | 'iPhone 8 Plus landscape'\n | 'iPhone SE'\n | 'iPhone SE landscape'\n | 'iPhone X'\n | 'iPhone X landscape'\n | 'iPhone XR'\n | 'iPhone XR landscape'\n | 'iPhone 11'\n | 'iPhone 11 landscape'\n | 'iPhone 11 Pro'\n | 'iPhone 11 Pro landscape'\n | 'iPhone 11 Pro Max'\n | 'iPhone 11 Pro Max landscape'\n | 'iPhone 12'\n | 'iPhone 12 landscape'\n | 'iPhone 12 Pro'\n | 'iPhone 12 Pro landscape'\n | 'iPhone 12 Pro Max'\n | 'iPhone 12 Pro Max landscape'\n | 'iPhone 12 Mini'\n | 'iPhone 12 Mini landscape'\n | 'iPhone 13'\n | 'iPhone 13 landscape'\n | 'iPhone 13 Pro'\n | 'iPhone 13 Pro landscape'\n | 'iPhone 13 Pro Max'\n | 'iPhone 13 Pro Max landscape'\n | 'iPhone 13 Mini'\n | 'iPhone 13 Mini landscape'\n | 'JioPhone 2'\n | 'JioPhone 2 landscape'\n | 'Kindle Fire HDX'\n | 'Kindle Fire HDX landscape'\n | 'LG Optimus L70'\n | 'LG Optimus L70 landscape'\n | 'Microsoft Lumia 550'\n | 'Microsoft Lumia 950'\n | 'Microsoft Lumia 950 landscape'\n | 'Nexus 10'\n | 'Nexus 10 landscape'\n | 'Nexus 4'\n | 'Nexus 4 landscape'\n | 'Nexus 5'\n | 'Nexus 5 landscape'\n | 'Nexus 5X'\n | 'Nexus 5X landscape'\n | 'Nexus 6'\n | 'Nexus 6 landscape'\n | 'Nexus 6P'\n | 'Nexus 6P landscape'\n | 'Nexus 7'\n | 'Nexus 7 landscape'\n | 'Nokia Lumia 520'\n | 'Nokia Lumia 520 landscape'\n | 'Nokia N9'\n | 'Nokia N9 landscape'\n | 'Pixel 2'\n | 'Pixel 2 landscape'\n | 'Pixel 2 XL'\n | 'Pixel 2 XL landscape'\n | 'Pixel 3'\n | 'Pixel 3 landscape'\n | 'Pixel 4'\n | 'Pixel 4 landscape'\n | 'Pixel 4a (5G)'\n | 'Pixel 4a (5G) landscape'\n | 'Pixel 5'\n | 'Pixel 5 landscape'\n | 'Moto G4'\n | 'Moto G4 landscape',\n Device\n >\n>;\n"})}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"import {KnownDevices} from 'puppeteer';\nconst iPhone = KnownDevices['iPhone 6'];\n\n(async () => {\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.emulate(iPhone);\n await page.goto('https://www.google.com');\n // other actions...\n await browser.close();\n})();\n"})})]})}function d(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(t,{...e})}):t(e)}},75251:(e,n,a)=>{var i=a(67294),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function p(e,n,a){var i,s={},p=null,t=null;for(i in void 0!==a&&(p=""+a),void 0!==n.key&&(p=""+n.key),void 0!==n.ref&&(t=n.ref),n)l.call(n,i)&&!c.hasOwnProperty(i)&&(s[i]=n[i]);if(e&&e.defaultProps)for(i in n=e.defaultProps)void 0===s[i]&&(s[i]=n[i]);return{$$typeof:o,type:e,key:p,ref:t,props:s,_owner:r.current}}n.Fragment=s,n.jsx=p,n.jsxs=p},85893:(e,n,a)=>{e.exports=a(75251)},11151:(e,n,a)=>{a.d(n,{Z:()=>r,a:()=>l});var i=a(67294);const o={},s=i.createContext(o);function l(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); |