Struct cef::browser::BrowserSettings
source · pub struct BrowserSettings {Show 27 fields
pub windowless_frame_rate: usize,
pub standard_font_family: CefString,
pub fixed_font_family: CefString,
pub serif_font_family: CefString,
pub sans_serif_font_family: CefString,
pub cursive_font_family: CefString,
pub fantasy_font_family: CefString,
pub default_font_size: u32,
pub default_fixed_font_size: u32,
pub minimum_font_size: u32,
pub minimum_logical_font_size: u32,
pub default_encoding: CefString,
pub remote_fonts: State,
pub javascript: State,
pub javascript_close_windows: State,
pub javascript_access_clipboard: State,
pub javascript_dom_paste: State,
pub image_loading: State,
pub image_shrink_standalone_to_fit: State,
pub text_area_resize: State,
pub tab_to_links: State,
pub local_storage: State,
pub databases: State,
pub webgl: State,
pub background_color: u32,
pub accept_language_list: CefString,
pub chrome_status_bubble: State,
}
Expand description
Browser initialization settings. Specify NULL or 0 to get the recommended default values. The consequences of using custom values may not be well tested. Many of these and other settings can also configured using command- line switches.
Fields§
§windowless_frame_rate: usize
The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint will be called for a windowless browser. The actual fps may be lower if the browser cannot generate frames at the requested rate. The minimum value is 1 and the maximum value is 60 (default 30). This value can also be changed dynamically via CefBrowserHost::SetWindowlessFrameRate.
standard_font_family: CefString
BEGIN values that map to WebPreferences settings. Font settings.
fixed_font_family: CefString
§serif_font_family: CefString
§sans_serif_font_family: CefString
§cursive_font_family: CefString
§fantasy_font_family: CefString
§default_font_size: u32
§default_fixed_font_size: u32
§minimum_font_size: u32
§minimum_logical_font_size: u32
§default_encoding: CefString
Default encoding for Web content. If empty “ISO-8859-1” will be used. Also configurable using the “default-encoding” command-line switch.
remote_fonts: State
the “disable-remote-fonts” command-line switch.
javascript: State
Controls whether JavaScript can be executed. Also configurable using the “disable-javascript” command-line switch.
javascript_close_windows: State
Controls whether JavaScript can be used to close windows that were not opened via JavaScript. JavaScript can still be used to close windows that were opened via JavaScript or that have no back/forward history. Also configurable using the “disable-javascript-close-windows” command-line switch.
javascript_access_clipboard: State
Controls whether JavaScript can access the clipboard. Also configurable using the “disable-javascript-access-clipboard” command-line switch.
javascript_dom_paste: State
Controls whether DOM pasting is supported in the editor via execCommand(“paste”). The |javascript_access_clipboard| setting must also be enabled. Also configurable using the “disable-javascript-dom-paste” command-line switch.
image_loading: State
Controls whether image URLs will be loaded from the network. A cached image will still be rendered if requested. Also configurable using the “disable-image-loading” command-line switch.
image_shrink_standalone_to_fit: State
Controls whether standalone images will be shrunk to fit the page. Also configurable using the “image-shrink-standalone-to-fit” command-line switch.
text_area_resize: State
Controls whether text areas can be resized. Also configurable using the “disable-text-area-resize” command-line switch.
tab_to_links: State
Controls whether the tab key can advance focus to links. Also configurable using the “disable-tab-to-links” command-line switch.
local_storage: State
Controls whether local storage can be used. Also configurable using the “disable-local-storage” command-line switch.
databases: State
Controls whether databases can be used. Also configurable using the “disable-databases” command-line switch.
webgl: State
Controls whether WebGL can be used. Note that WebGL requires hardware support and may not work on all systems even when enabled. Also configurable using the “disable-webgl” command-line switch.
background_color: u32
END values that map to WebPreferences settings. Background color used for the browser before a document is loaded and when no document color is specified. The alpha component must be either fully opaque (0xFF) or fully transparent (0x00). If the alpha component is fully opaque then the RGB components will be used as the background color. If the alpha component is fully transparent for a windowed browser then the CefSettings.background_color value will be used. If the alpha component is fully transparent for a windowless (off-screen) browser then transparent painting will be enabled.
accept_language_list: CefString
Comma delimited ordered list of language codes without any whitespace that will be used in the “Accept-Language” HTTP header. May be set globally using the CefSettings.accept_language_list value. If both values are empty then “en-US,en” will be used.
chrome_status_bubble: State
Controls whether the Chrome status bubble will be used. Only supported with the Chrome runtime. For details about the status bubble see https://www.chromium.org/user-experience/status-bubble/
Implementations§
source§impl BrowserSettings
impl BrowserSettings
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
fn main() {
unsafe {
let args = Args::new(std::env::args());
let app = Application;
dbg!(cef::execute_process(&args, Some(app)));
let settings = Settings::new();
dbg!(cef::initialize(&args, settings, Some(app)));
let window_info = WindowInfo::new();
let browser_settings = BrowserSettings::new();
let client = DemoClient;
let url = CefString::new("https://www.google.com");
dbg!(cef::browser::create_browser(
window_info,
Some(client),
url,
browser_settings
));
cef_sys::cef_run_message_loop();
}
}
pub fn into_raw(self) -> cef_browser_settings_t
Trait Implementations§
source§impl Clone for BrowserSettings
impl Clone for BrowserSettings
source§fn clone(&self) -> BrowserSettings
fn clone(&self) -> BrowserSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more