You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main problem is when intercepting a navigation request (e.g. a link to a page points or redirects to a pdf or another type of document we don't want to).
For example a simple approach:
// Enable request interceptionsawaitpage.setRequestInterception(true);// do not load images and fontsawaitpage.on("request",(request)=>{if(request.isInterceptResolutionHandled())return;if(request.isNavigationRequest())request.abort("blockedbyclient");elserequest.continue();});
Or intercepting the response:
constclient=awaitpage.createCDPSession();constcTypeHeader="content-type";constcTypeExp=/\bhtml\b/i;consterrorReason="BlockedByClient";// intercept request when response headers were receivedawaitclient.send('Fetch.enable',{patterns: [{urlPattern: '*',resourceType: 'Document',requestStage: 'Response'}],});awaitclient.on('Fetch.requestPaused',asyncevt=>{constrequestId=evt.requestId;conststatus=evt.responseStatusCode;if(status>=200&&status<=299){constheaders=evt.responseHeaders||[];constcontentType=headers.find(h=>h.name.toLowerCase()==cTypeHeader)?.value;// Do not allow anything other than html document.if(contentType&&!cTypeExp.test(contentType))returnawaitclient.send('Fetch.failRequest',{ requestId, errorReason }).catch(none);}awaitclient.send('Fetch.continueRequest',{ requestId }).catch(none);});
Both lead to the same situation when the browser kills the renderer and occasionally dies as they are in a single process 😀
The bug report is here and I was about to submit one more with crbug.com. But was also wondering if it is possible to run chromium without the --single-process flag. I tried just removing the flag but didn't have much success so far.
The text was updated successfully, but these errors were encountered:
Sparticuz
changed the title
[Bug]: Browser crashes when a navigational request is aborted using --single-process flag
Browser crashes when a navigational request is aborted using --single-process flag
Apr 4, 2024
This is rather a question, not a bug report.
The main problem is when intercepting a navigation request (e.g. a link to a page points or redirects to a pdf or another type of document we don't want to).
For example a simple approach:
Or intercepting the response:
Both lead to the same situation when the browser kills the renderer and occasionally dies as they are in a single process 😀
The bug report is here and I was about to submit one more with crbug.com. But was also wondering if it is possible to run chromium without the
--single-process
flag. I tried just removing the flag but didn't have much success so far.The text was updated successfully, but these errors were encountered: