"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[37273],{3905:(e,t,n)=>{n.d(t,{Zo:()=>l,kt:()=>h});varr=n(67294);functiono(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functioni(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functiona(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functions(e,t){if(null==e)return{};varn,r,o=function(e,t){if(null==e)return{};varn,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);returno}(e,t);if(Object.getOwnPropertySymbols){vari=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}returno}varp=r.createContext({}),u=function(e){vart=r.useContext(p),n=t;returne&&(n="function"==typeofe?e(t):a(a({},t),e)),n},l=function(e){vart=u(e.components);returnr.createElement(p.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){vart=e.children;returnr.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){varn=e.components,o=e.mdxType,i=e.originalType,p=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),d=u(n),h=o,y=d["".concat(p,".").concat(h)]||d[h]||c[h]||i;returnn?r.createElement(y,a(a({ref:t},l),{},{components:n})):r.createElement(y,a({ref:t},l))}));functionh(e,t){varn=arguments,o=t&&t.mdxType;if("string"==typeofe||o){vari=n.length,a=newArray(i);a[0]=d;vars={};for(varpint)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeofe?e:o,a[1]=s;for(varu=2;u<i;u++)a[u]=n[u];returnr.createElement.apply(null,a)}returnr.createElement.apply(null,n)}d.displayName="MDXCreateElement"},72979:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>c,frontMatter:()=>i,metadata:()=>s,toc:()=>u});varr=n(87462),o=(n(67294),n(3905));consti={},a="Request interception",s={unversionedId:"guides/request-interception",id:"version-17.1.1/guides/request-interception",title:"Request interception",description:"Once request interception is enabled, every request will stall unless it's continued, responded or aborted.",source:"@site/versioned_docs/version-17.1.1/guides/request-interception.md",sourceDirName:"guides",slug:"/guides/request-interception",permalink:"/guides/request-interception",draft:!1,tags:[],version:"17.1.1",frontMatter:{},sidebar:"sidebar",previous:{title:"Guides",permalink:"/guides/"},next:{title:"API",permalink:"/api/"}},p={},u=[{value:"Multiple Intercept Handlers and Asynchronous Resolutions",id:"multiple-intercept-handlers-and-asynchronous-resolutions",level:2},{value:"Cooperative Intercept Mode",id:"cooperative-intercept-mode",level:2},{value:"Cooperative Request Continuation",id:"cooperative-request-continuation",level:2},{value:"Upgrading to Cooperative Intercept Mode for package maintainers",id:"upgrading-to-cooperative-intercept-mode-for-package-maintainers",level:2}],l={toc:u};functionc(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,r.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"request-interception"},"Request interception"),(0,o.kt)("p",null,"Once request interception is enabled, every request will stall unless it's continued, responded or aborted."),(0,o.kt)("p",null,"An example of a na\xefve request interceptor that aborts all image requests:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-js"},"constpuppeteer=require('puppeteer');\n\n(async()=>{\nconstbrowser=awaitpuppeteer.launch();\nconstpage=awaitbrowser.newPage();\nawaitpage.setRequestI