pub struct ContentScript {
pub matches: Vec<String>,
pub exclude_matches: Vec<String>,
pub js: Vec<String>,
pub css: Vec<String>,
pub run_at: Option<String>,
}Expand description
A single content_scripts entry from the manifest.
Content scripts are the dominant cross-origin exposure surface in a Chrome
extension: each entry injects code into every page matching one of its
matches patterns, so the match list plus the script file list is the
first thing a security review looks at.
Fields§
§matches: Vec<String>The matches array — match patterns the script runs on. Required by
the manifest spec; if absent or non-string this is empty.
exclude_matches: Vec<String>The exclude_matches array, if present.
js: Vec<String>The js files injected into matching pages.
css: Vec<String>The css files injected into matching pages.
run_at: Option<String>Whether run_at is document_start (scripts inject before the page
builds its DOM, the position that sees every password field as it is
created). None means the field was absent (Chrome defaults to
document_idle).
Trait Implementations§
Source§impl Clone for ContentScript
impl Clone for ContentScript
Source§fn clone(&self) -> ContentScript
fn clone(&self) -> ContentScript
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentScript
impl Debug for ContentScript
Source§impl Default for ContentScript
impl Default for ContentScript
Source§fn default() -> ContentScript
fn default() -> ContentScript
impl Eq for ContentScript
Source§impl PartialEq for ContentScript
impl PartialEq for ContentScript
Source§fn eq(&self, other: &ContentScript) -> bool
fn eq(&self, other: &ContentScript) -> bool
self and other values to be equal, and is used by ==.