#[non_exhaustive]pub enum DevToolsPolicy {
Auto,
Allowed,
Disallowed,
}Expand description
Whether this application may open a DevTools window at all.
Application-wide, and combined with the per-webview WebviewAttributes::devtools:
either one saying no is a no. Both are enforced on the paths this runtime owns — the
context menu entries, the F12 and Ctrl+Shift+I chords, the IDC_DEV_TOOLS commands
and Webview::open_devtools.
§Why it is not Chromium’s own preference
Chromium has a profile preference for exactly this, devtools.availability, and
DevToolsWindow::AllowDevToolsFor consults it on every path that opens a DevTools
window — including the ones this runtime does not own, such as a Chrome-owned popup.
This policy deliberately does not reach for it, and the runtime pins it to its
default instead.
CEF gates more than the window on that preference: SendDevToolsMessage is refused on
a profile carrying kDisallowed, and refused silently — the send still reports
success, and no result or event ever reaches a registered observer. This runtime
drives its own startup over the DevTools protocol (the document-start scripts, the
per-webview user agent) and holds each webview’s first navigation until that round
trip answers, so setting the preference leaves every window stuck on a blank
placeholder. A webview’s on_dev_tools_protocol would go silent with it.
So the DevTools protocol stays available whatever this policy says. An application
that has to close that path too wants RemoteDebugging, which is what exposes the
protocol to anything outside the process.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auto
Allow DevTools in a build that could open them anyway — a debug build, or one with
the devtools feature — and refuse them otherwise.
Allowed
Allow DevTools, whatever the build profile.
Per-webview WebviewAttributes::devtools still applies; this only stops the runtime
from refusing DevTools application-wide.
Disallowed
Refuse DevTools, whatever the build profile.
Trait Implementations§
Source§impl Clone for DevToolsPolicy
impl Clone for DevToolsPolicy
impl Copy for DevToolsPolicy
Source§impl Debug for DevToolsPolicy
impl Debug for DevToolsPolicy
Source§impl Default for DevToolsPolicy
impl Default for DevToolsPolicy
impl Eq for DevToolsPolicy
Source§impl PartialEq for DevToolsPolicy
impl PartialEq for DevToolsPolicy
impl StructuralPartialEq for DevToolsPolicy
Auto Trait Implementations§
impl Freeze for DevToolsPolicy
impl RefUnwindSafe for DevToolsPolicy
impl Send for DevToolsPolicy
impl Sync for DevToolsPolicy
impl Unpin for DevToolsPolicy
impl UnsafeUnpin for DevToolsPolicy
impl UnwindSafe for DevToolsPolicy
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§impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.