Struct webkit6::UserScript
source · pub struct UserScript { /* private fields */ }
Expand description
A JavaScript snippet which can be injected in loaded pages.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
source§impl UserScript
impl UserScript
sourcepub fn as_ptr(&self) -> *mut WebKitUserScript
pub fn as_ptr(&self) -> *mut WebKitUserScript
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitUserScript) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitUserScript) -> &Self
Borrows the underlying C value.
source§impl UserScript
impl UserScript
sourcepub fn new(
source: &str,
injected_frames: UserContentInjectedFrames,
injection_time: UserScriptInjectionTime,
allow_list: &[&str],
block_list: &[&str],
) -> UserScript
pub fn new( source: &str, injected_frames: UserContentInjectedFrames, injection_time: UserScriptInjectionTime, allow_list: &[&str], block_list: &[&str], ) -> UserScript
Creates a new user script.
Scripts can be applied to some URIs
only by passing non-null values for @allow_list or @block_list. Passing a
None
allow_list implies that all URIs are on the allow_list. The script
is applied if an URI matches the allow_list and not the block_list.
URI patterns must be of the form [protocol]://[host]/[path]
, where the
host and path components can contain the wildcard character (*
) to
represent zero or more other characters.
§source
Source code of the user script.
§injected_frames
A #WebKitUserContentInjectedFrames value
§injection_time
A #WebKitUserScriptInjectionTime value
§allow_list
An allow_list of URI patterns or None
§block_list
A block_list of URI patterns or None
§Returns
A new #WebKitUserScript
sourcepub fn for_world(
source: &str,
injected_frames: UserContentInjectedFrames,
injection_time: UserScriptInjectionTime,
world_name: &str,
allow_list: &[&str],
block_list: &[&str],
) -> UserScript
pub fn for_world( source: &str, injected_frames: UserContentInjectedFrames, injection_time: UserScriptInjectionTime, world_name: &str, allow_list: &[&str], block_list: &[&str], ) -> UserScript
Creates a new user script for script world with name @world_name.
See webkit_user_script_new() for a full description.
§source
Source code of the user script.
§injected_frames
A #WebKitUserContentInjectedFrames value
§injection_time
A #WebKitUserScriptInjectionTime value
§world_name
the name of a #WebKitScriptWorld
§allow_list
An allow_list of URI patterns or None
§block_list
A block_list of URI patterns or None
§Returns
A new #WebKitUserScript
Trait Implementations§
source§impl Clone for UserScript
impl Clone for UserScript
source§impl Debug for UserScript
impl Debug for UserScript
source§impl From<UserScript> for Value
impl From<UserScript> for Value
source§fn from(s: UserScript) -> Self
fn from(s: UserScript) -> Self
source§impl HasParamSpec for UserScript
impl HasParamSpec for UserScript
type ParamSpec = ParamSpecBoxed
§type SetValue = UserScript
type SetValue = UserScript
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, UserScript>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for UserScript
impl Hash for UserScript
source§impl Ord for UserScript
impl Ord for UserScript
source§fn cmp(&self, other: &UserScript) -> Ordering
fn cmp(&self, other: &UserScript) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for UserScript
impl PartialEq for UserScript
source§fn eq(&self, other: &UserScript) -> bool
fn eq(&self, other: &UserScript) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for UserScript
impl PartialOrd for UserScript
source§fn partial_cmp(&self, other: &UserScript) -> Option<Ordering>
fn partial_cmp(&self, other: &UserScript) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for UserScript
impl StaticType for UserScript
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for UserScript
impl StructuralPartialEq for UserScript
Auto Trait Implementations§
impl Freeze for UserScript
impl RefUnwindSafe for UserScript
impl !Send for UserScript
impl !Sync for UserScript
impl Unpin for UserScript
impl UnwindSafe for UserScript
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)