extendedcss

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: BSD-3-Clause, GPL-3.0, MIT, + 1 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExtPseudoClassRegex matches extended pseudo-classes.
	ExtPseudoClassRegex = regexp.MustCompile(`:(?:has-text|contains|matches-attr|matches-css(?:-before|-after)?|matches-media|matches-path|matches-prop(?:erty)?|min-text-length|others|upward|xpath|nth-ancestor|watch-attr|remove|style|-abp-(?:contains|has))`)
)

Functions

func IsRule

func IsRule(s string) bool

IsRule returns true if the given string is an extended CSS rule.

Types

type Injector

type Injector struct {
	// contains filtered or unexported fields
}

Injector injects extended CSS rules into HTML HTTP responses.

func NewInjectorWithDefaults

func NewInjectorWithDefaults() (*Injector, error)

func (*Injector) AddRule

func (inj *Injector) AddRule(rule string) error

AddRule adds an extended CSS rule to the injector.

func (*Injector) Inject

func (inj *Injector) Inject(req *http.Request, res *http.Response) error

Inject injects extended-css rules into a given HTTP HTML response.

On error, the caller may proceed as if the function had not been called.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL