"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[55921],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});varn=r(67294);functiona(e,t,r){returntine?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}functiono(e,t){varr=Object.keys(e);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}returnr}functionp(e){for(vart=1;t<arguments.length;t++){varr=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}returne}functions(e,t){if(null==e)return{};varr,n,a=function(e,t){if(null==e)return{};varr,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);returna}(e,t);if(Object.getOwnPropertySymbols){varo=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}returna}varl=n.createContext({}),i=function(e){vart=n.useContext(l),r=t;returne&&(r="function"==typeofe?e(t):p(p({},t),e)),r},c=function(e){vart=i(e.components);returnn.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){vart=e.children;returnn.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){varr=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=i(r),m=a,w=u["".concat(l,".").concat(m)]||u[m]||d[m]||o;returnr?n.createElement(w,p(p({ref:t},c),{},{components:r})):n.createElement(w,p({ref:t},c))}));functionm(e,t){varr=arguments,a=t&&t.mdxType;if("string"==typeofe||a){varo=r.length,p=newArray(o);p[0]=u;vars={};for(varlint)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeofe?e:a,p[1]=s;for(vari=2;i<o;i++)p[i]=r[i];returnn.createElement.apply(null,p)}returnn.createElement.apply(null,r)}u.displayName="MDXCreateElement"},46520:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>p,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>i});varn=r(87462),a=(r(67294),r(3905));consto={sidebar_label:"BrowserContext"},p="BrowserContext class",s={unversionedId:"api/puppeteer.browsercontext",id:"version-17.0.0/api/puppeteer.browsercontext",title:"BrowserContext class",description:"BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method Browser.newPage creates a page in the default browser context.",source:"@site/versioned_docs/version-17.0.0/api/puppeteer.browsercontext.md",sourceDirName:"api",slug:"/api/puppeteer.browsercontext",permalink:"/api/puppeteer.browsercontext",draft:!1,tags:[],version:"17.0.0",frontMatter:{sidebar_label:"BrowserContext"},sidebar:"sidebar",previous:{title:"BrowserContext.isIncognito",permalink:"/api/puppeteer.browsercontext.isincognito"},next:{title:"BrowserContext.newPage",permalink:"/api/puppeteer.browsercontext.newpage"}},l={},i=[{value:"Remarks",id:"remarks",level:2},{value:"Example",id:"example",level:2},{value:"Methods",id:"methods",level:2}],c={toc:i};functiond(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"browsercontext-class"},"BrowserContext class"),(0,a.kt)("p",null,"BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method ",(0,a.kt)("a",{parentName:"p",href:"/api/puppeteer.browser.newpage"},"Browser.newPage")," creates a page in the default browser context."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Signature:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-typescript"},"exportdeclareclassBrowserContextextends