In your case
def should_abort_request(request): return ( request.resource_type != "xhr" in request.url )
and apply the function in settings
PLAYWRIGHT_ABORT_REQUEST = should_abort_request