Right-click context menu

Shipped in v0.4.0 (#23). Replaces Chromium's native context menu with a custom-rendered buffr-ui::ContextMenuOverlay panel, driven by CEF's ContextMenuHandler. Items are bucketed by hit-test type; only the items relevant to the click target are shown.

Triggering the menu

Right-click anywhere in the page area. The menu appears at the cursor position (clamped to the viewport). Dismiss it with <Esc>, a click outside the panel, or by activating an item.

Navigation in the menu: <Up> / <Down> move row selection. <Enter> activates the selected item. Disabled rows (greyed text) cannot be activated. Any non-navigation key dismisses the menu and is passed to the normal page-mode dispatcher.

Bucket priority

When multiple flags apply to a click target, the highest-priority bucket wins:

PriorityBucketTrigger condition
1EditableTYPEFLAG_EDITABLE or is_editable
2LinkTYPEFLAG_LINK or a non-empty link_url
3ImageTYPEFLAG_MEDIA + MEDIATYPE_IMAGE
4MediaTYPEFLAG_MEDIA + MEDIATYPE_VIDEO/AUDIO
5SelectionTYPEFLAG_SELECTION (and not Editable)
6PageFallback — always shown when no bucket matches

Per-bucket items

Page (fallback)

Shown on a right-click on the page background, margin, or any element that doesn't match a higher-priority bucket.

VariantLabelNotes
HistoryBack { enabled: bool }BackGreyed when there is no previous history entry.
HistoryForward { enabled: bool }ForwardGreyed when there is no forward history entry.
ReloadReloadOnly when the page is not loading.
StopLoadingStop LoadingOnly while the page is loading (replaces Reload).
ViewPageSourceView Page SourceOpens buffr-src:<url> in a new tab. See below.
InspectElementInspect ElementOpens DevTools at the right-click hit-point.

Right-clicking a hyperlink (<a href="..."> or any element with a URL).

VariantLabelNotes
OpenLinkInNewTabOpen Link in New TabForeground tab.
OpenLinkInBackgroundTabOpen Link in Background TabBackground tab (tab strip focus unchanged).
OpenLinkInNewWindowOpen Link in New WindowCurrently treated as a new tab (#18).
CopyLinkAddressCopy Link AddressWrites the URL to the clipboard.
SaveLinkAsSave Link As…Triggers a CEF download of the link URL.
InspectElementInspect ElementOpens DevTools at the right-click hit-point.

Image

Right-clicking an <img> or other image-type media element.

VariantLabelNotes
OpenImageInNewTabOpen Image in New TabNavigates to the image URL directly.
SaveImageAsSave Image As…Triggers a CEF download.
CopyImageCopy ImageFetches off-thread, transcodes to PNG, writes clipboard.
CopyImageAddressCopy Image AddressWrites the image URL as text to the clipboard.
InspectElementInspect ElementOpens DevTools at the right-click hit-point.

CopyImage falls back to writing the image URL as text when the clipboard backend doesn't support image MIME (e.g. OSC52 over SSH).

Media (video / audio)

Right-clicking a <video> or <audio> element. Items whose media-state flag is not set are omitted (e.g. MediaSaveAs only appears when CAN_SAVE is reported; PictureInPicture only when CAN_PICTURE_IN_PICTURE is reported).

VariantLabelNotes
MediaPlayPause { playing: bool }Pause / Play"Pause" when playing; "Play" when paused.
MediaMute { muted: bool }Mute / Unmute"Unmute" when already muted.
MediaLoop { looped: bool }Enable/Disable LoopToggles <video>.loop.
MediaShowControlsShow ControlsToggling native controls; only shown when CAN_TOGGLE_CONTROLS.
MediaSaveAsSave Media As…Only shown when CAN_SAVE flag is set.
CopyMediaAddressCopy Media AddressWrites the media URL as text to the clipboard.
PictureInPicturePicture in PictureOnly shown when CAN_PICTURE_IN_PICTURE is set.
InspectElementInspect ElementOpens DevTools at the right-click hit-point.

All media actions resolve the target element via document.elementFromPoint with a querySelector('video, audio') fallback for sites (e.g. YouTube) where the click target is a sibling/overlay rather than an ancestor of the media element.

Selection

Right-clicking a text selection that is not inside an editable field.

VariantLabelNotes
CopySelectionCopyWrites selection_text to clipboard (CEF fallback).
SearchSelectionSearch for SelectionOpens the selection as a search query in a new tab.
InspectElementInspect ElementOpens DevTools at the right-click hit-point.

Editable

Right-clicking an editable field (<input>, <textarea>, contenteditable). All ops are dispatched as CEF frame edit commands to the focused frame.

VariantLabelNotes
CutCutcef_frame_t edit command.
CopyCopycef_frame_t edit command.
PastePastecef_frame_t edit command.
PasteAsPlainTextPaste as Plain TextStrips rich formatting before insert.
SelectAllSelect Allcef_frame_t edit command.
UndoUndocef_frame_t edit command.
RedoRedocef_frame_t edit command.

buffr-src: URL prefix

ViewPageSource navigates to buffr-src:<url> — the user-facing alias for Chromium's view-source: scheme. Navigations to buffr-src:<url> are rewritten to view-source:<url> at the CEF boundary. The omnibar, tab strip, and session file all store the buffr-src: prefixed form uniformly.

You can also type buffr-src:https://example.com directly in the omnibar to view source without using the menu.

Known issues

  • PictureInPicture no-ops on YouTube. The item fires media_picture_in_picture, which calls the browser's PiP API via JS injection. YouTube's embedded player rejects PiP calls unless they are initiated from a trusted user gesture — CEF's JS injection does not carry transient user activation across the OSR boundary. Tracked in issue #31.