Menu

Struct

ContextMenuTarget

kurogane::ContextMenuTargetSource
pub struct ContextMenuTarget { /* private fields */ }

What a right-click was on.

Methods

#pub fn origin(&self) -> &Origin

Returns the origin of the document right-clicked (the page’s or a frame’s inside it). A sandboxed document’s origin is opaque here whatever its URL.

#pub fn page_url(&self) -> &str

The URL of the page the browser shows.

#pub fn frame_url(&self) -> &str

The URL of the document right-clicked, the page’s or a frame’s.

#pub fn media(&self) -> Option<MediaKind>

Returns the kind of media right-clicked (for example an image or a video).

#pub fn media_url(&self) -> Option<&str>

The URL of the media right-clicked, when it has one.

#pub fn selection(&self) -> Option<&str>

The text selected where the right-click was.

#pub fn is_editable(&self) -> bool

Whether the right-click was in a text field or other editable content.

#pub fn misspelled_word(&self) -> Option<&str>

The misspelled word right-clicked.

#pub fn position(&self) -> (i32, i32)

Where the right-click was, in the browser’s view.

#pub fn browser(&self) -> Option<BrowserId>

The browser right-clicked.

Trait implementations