Trait webkit2gtk::prelude::WebContextExt
source · [−]pub trait WebContextExt: 'static {
Show 49 methods
fn add_path_to_sandbox(&self, path: impl AsRef<Path>, read_only: bool);
fn allow_tls_certificate_for_host(
&self,
certificate: &impl IsA<TlsCertificate>,
host: &str
);
fn clear_cache(&self);
fn download_uri(&self, uri: &str) -> Option<Download>;
fn cache_model(&self) -> CacheModel;
fn cookie_manager(&self) -> Option<CookieManager>;
fn favicon_database(&self) -> Option<FaviconDatabase>;
fn favicon_database_directory(&self) -> Option<GString>;
fn geolocation_manager(&self) -> Option<GeolocationManager>;
fn plugins<P: FnOnce(Result<Vec<Plugin>, Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn plugins_future(
&self
) -> Pin<Box_<dyn Future<Output = Result<Vec<Plugin>, Error>> + 'static>>;
fn process_model(&self) -> ProcessModel;
fn is_sandbox_enabled(&self) -> bool;
fn security_manager(&self) -> Option<SecurityManager>;
fn is_spell_checking_enabled(&self) -> bool;
fn spell_checking_languages(&self) -> Vec<GString>;
fn time_zone_override(&self) -> Option<GString>;
fn tls_errors_policy(&self) -> TLSErrorsPolicy;
fn uses_system_appearance_for_scrollbars(&self) -> bool;
fn web_process_count_limit(&self) -> u32;
fn website_data_manager(&self) -> Option<WebsiteDataManager>;
fn initialize_notification_permissions(
&self,
allowed_origins: &[&SecurityOrigin],
disallowed_origins: &[&SecurityOrigin]
);
fn is_automation_allowed(&self) -> bool;
fn is_ephemeral(&self) -> bool;
fn prefetch_dns(&self, hostname: &str);
fn register_uri_scheme<P: Fn(&URISchemeRequest) + 'static>(
&self,
scheme: &str,
callback: P
);
fn send_message_to_all_extensions(&self, message: &impl IsA<UserMessage>);
fn set_additional_plugins_directory(&self, directory: &str);
fn set_automation_allowed(&self, allowed: bool);
fn set_cache_model(&self, cache_model: CacheModel);
fn set_disk_cache_directory(&self, directory: &str);
fn set_favicon_database_directory(&self, path: Option<&str>);
fn set_preferred_languages(&self, languages: &[&str]);
fn set_process_model(&self, process_model: ProcessModel);
fn set_sandbox_enabled(&self, enabled: bool);
fn set_spell_checking_enabled(&self, enabled: bool);
fn set_spell_checking_languages(&self, languages: &[&str]);
fn set_tls_errors_policy(&self, policy: TLSErrorsPolicy);
fn set_use_system_appearance_for_scrollbars(&self, enabled: bool);
fn set_web_extensions_directory(&self, directory: &str);
fn set_web_extensions_initialization_user_data(&self, user_data: &Variant);
fn set_web_process_count_limit(&self, limit: u32);
fn local_storage_directory(&self) -> Option<GString>;
fn is_process_swap_on_cross_site_navigation_enabled(&self) -> bool;
fn connect_automation_started<F: Fn(&Self, &AutomationSession) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_download_started<F: Fn(&Self, &Download) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_initialize_notification_permissions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_initialize_web_extensions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_user_message_received<F: Fn(&Self, &UserMessage) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn add_path_to_sandbox(&self, path: impl AsRef<Path>, read_only: bool)
fn add_path_to_sandbox(&self, path: impl AsRef<Path>, read_only: bool)
Available on crate feature
v2_26
only.Adds a path to be mounted in the sandbox.
path
must exist before any web process
has been created otherwise it will be silently ignored. It is a fatal error to
add paths after a web process has been spawned.
Paths in directories such as /sys
, /proc
, and /dev
or all of /
are not valid.
See also set_sandbox_enabled()
path
an absolute path to mount in the sandbox
read_only
if true
the path will be read-only
sourcefn allow_tls_certificate_for_host(
&self,
certificate: &impl IsA<TlsCertificate>,
host: &str
)
fn allow_tls_certificate_for_host(
&self,
certificate: &impl IsA<TlsCertificate>,
host: &str
)
Available on crate feature
v2_6
only.fn clear_cache(&self)
fn download_uri(&self, uri: &str) -> Option<Download>
fn cache_model(&self) -> CacheModel
fn favicon_database(&self) -> Option<FaviconDatabase>
fn favicon_database_directory(&self) -> Option<GString>
sourcefn geolocation_manager(&self) -> Option<GeolocationManager>
fn geolocation_manager(&self) -> Option<GeolocationManager>
Available on crate feature
v2_26
only.sourcefn plugins<P: FnOnce(Result<Vec<Plugin>, Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)
fn plugins<P: FnOnce(Result<Vec<Plugin>, Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)
👎Deprecated: Since 2.32
sourcefn plugins_future(
&self
) -> Pin<Box_<dyn Future<Output = Result<Vec<Plugin>, Error>> + 'static>>
fn plugins_future(
&self
) -> Pin<Box_<dyn Future<Output = Result<Vec<Plugin>, Error>> + 'static>>
👎Deprecated: Since 2.32
sourcefn process_model(&self) -> ProcessModel
fn process_model(&self) -> ProcessModel
Available on crate feature
v2_4
only.sourcefn is_sandbox_enabled(&self) -> bool
fn is_sandbox_enabled(&self) -> bool
Available on crate feature
v2_26
only.fn security_manager(&self) -> Option<SecurityManager>
fn is_spell_checking_enabled(&self) -> bool
fn spell_checking_languages(&self) -> Vec<GString>
sourcefn time_zone_override(&self) -> Option<GString>
fn time_zone_override(&self) -> Option<GString>
Available on crate feature
v2_38
only.sourcefn tls_errors_policy(&self) -> TLSErrorsPolicy
fn tls_errors_policy(&self) -> TLSErrorsPolicy
👎Deprecated: Since 2.32
sourcefn uses_system_appearance_for_scrollbars(&self) -> bool
fn uses_system_appearance_for_scrollbars(&self) -> bool
Available on crate feature
v2_30
only.sourcefn web_process_count_limit(&self) -> u32
fn web_process_count_limit(&self) -> u32
👎Deprecated: Since 2.26
Available on crate feature
v2_10
only.sourcefn website_data_manager(&self) -> Option<WebsiteDataManager>
fn website_data_manager(&self) -> Option<WebsiteDataManager>
Available on crate feature
v2_10
only.sourcefn initialize_notification_permissions(
&self,
allowed_origins: &[&SecurityOrigin],
disallowed_origins: &[&SecurityOrigin]
)
fn initialize_notification_permissions(
&self,
allowed_origins: &[&SecurityOrigin],
disallowed_origins: &[&SecurityOrigin]
)
Available on crate feature
v2_16
only.sourcefn is_automation_allowed(&self) -> bool
fn is_automation_allowed(&self) -> bool
Available on crate feature
v2_18
only.sourcefn is_ephemeral(&self) -> bool
fn is_ephemeral(&self) -> bool
Available on crate feature
v2_16
only.fn prefetch_dns(&self, hostname: &str)
fn register_uri_scheme<P: Fn(&URISchemeRequest) + 'static>(
&self,
scheme: &str,
callback: P
)
sourcefn send_message_to_all_extensions(&self, message: &impl IsA<UserMessage>)
fn send_message_to_all_extensions(&self, message: &impl IsA<UserMessage>)
Available on crate feature
v2_28
only.sourcefn set_additional_plugins_directory(&self, directory: &str)
fn set_additional_plugins_directory(&self, directory: &str)
👎Deprecated: Since 2.32
sourcefn set_automation_allowed(&self, allowed: bool)
fn set_automation_allowed(&self, allowed: bool)
Available on crate feature
v2_18
only.fn set_cache_model(&self, cache_model: CacheModel)
sourcefn set_disk_cache_directory(&self, directory: &str)
fn set_disk_cache_directory(&self, directory: &str)
👎Deprecated: Since 2.10
fn set_favicon_database_directory(&self, path: Option<&str>)
fn set_preferred_languages(&self, languages: &[&str])
sourcefn set_process_model(&self, process_model: ProcessModel)
fn set_process_model(&self, process_model: ProcessModel)
Available on crate feature
v2_4
only.sourcefn set_sandbox_enabled(&self, enabled: bool)
fn set_sandbox_enabled(&self, enabled: bool)
Available on crate feature
v2_26
only.fn set_spell_checking_enabled(&self, enabled: bool)
fn set_spell_checking_languages(&self, languages: &[&str])
sourcefn set_tls_errors_policy(&self, policy: TLSErrorsPolicy)
fn set_tls_errors_policy(&self, policy: TLSErrorsPolicy)
👎Deprecated: Since 2.32
sourcefn set_use_system_appearance_for_scrollbars(&self, enabled: bool)
fn set_use_system_appearance_for_scrollbars(&self, enabled: bool)
Available on crate feature
v2_30
only.fn set_web_extensions_directory(&self, directory: &str)
sourcefn set_web_extensions_initialization_user_data(&self, user_data: &Variant)
fn set_web_extensions_initialization_user_data(&self, user_data: &Variant)
Available on crate feature
v2_4
only.sourcefn set_web_process_count_limit(&self, limit: u32)
fn set_web_process_count_limit(&self, limit: u32)
👎Deprecated: Since 2.26
Available on crate feature
v2_10
only.sourcefn local_storage_directory(&self) -> Option<GString>
fn local_storage_directory(&self) -> Option<GString>
👎Deprecated: Since 2.10
Available on crate feature
v2_8
only.Available on crate feature
v2_28
only.sourcefn connect_automation_started<F: Fn(&Self, &AutomationSession) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_automation_started<F: Fn(&Self, &AutomationSession) + 'static>(
&self,
f: F
) -> SignalHandlerId
Available on crate feature
v2_18
only.fn connect_download_started<F: Fn(&Self, &Download) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_initialize_notification_permissions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_initialize_notification_permissions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
Available on crate feature
v2_16
only.sourcefn connect_initialize_web_extensions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_initialize_web_extensions<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
Available on crate feature
v2_4
only.sourcefn connect_user_message_received<F: Fn(&Self, &UserMessage) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_user_message_received<F: Fn(&Self, &UserMessage) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
Available on crate feature
v2_28
only.