pub struct Resource {
pub name: String,
pub aliases: Vec<String>,
pub kind: ResourceType,
pub content: String,
pub dependencies: Vec<String>,
pub permission: PermissionMask,
}
Expand description
Struct representing a resource that can be used by an adblocking engine.
Fields§
§name: String
Represents the primary name of the resource, often a filename
aliases: Vec<String>
Represents secondary names that can be used to access the resource
kind: ResourceType
How to interpret the resource data within content
content: String
The resource data, encoded using standard base64 configuration
dependencies: Vec<String>
Optionally contains the name of any dependencies used by this resource. Currently, this
only applies to application/javascript
and fn/javascript
MIME types.
Aliases should never be added to this list. It should only contain primary/canonical resource names.
Currently ignored, but will be respected in a future release. Bundle any required dependencies inside the resource for now.
permission: PermissionMask
Optionally defines permission levels required to use this resource for a scriptlet
injection. See PermissionMask
for more details.
If there is any customized permission, this resource cannot be used for redirects.
This field is similar to the requiresTrust
field from uBlock Origin’s scriptlet
resources, except that it supports up to 8 different trust “domains”.