Skip to content

Can lightpanda support blocking resource like image,audio,video,css? #914

@feeops

Description

@feeops

CDP can block some type resource,like image,audio,video,css.

It can save traffic and boot performace.

In go-rod example code

err = router.Add("*", "", func(ctx *rod.Hijack) {
		reqType := ctx.Request.Type()
		if reqType == proto.NetworkResourceTypeImage ||
			reqType == proto.NetworkResourceTypeMedia ||
			reqType == proto.NetworkResourceTypeFont ||
			reqType == proto.NetworkResourceTypeStylesheet {
			ctx.Response.Fail(proto.NetworkErrorReasonBlockedByClient)
			return
		}

		ctx.ContinueRequest(&proto.FetchContinueRequest{})

	})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions