browserSettings.contextMenuShowEvent
一个 BrowserSetting
对象,用于确定浏览器的上下文菜单是在 mouseup 事件还是 mousedown 事件显示。
其底层值是一个字符串,可以是“mouseup”或“mousedown”。
在 Windows 上,默认值为“mouseup”,在 macOS 和 Linux 上为“mousedown”。在 Windows 上对其进行赋值没有效果——此设置仅设计为允许上下文菜单在 mouseup 事件时打开,而不是在 mousedown 事件时。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
contextMenuShowEvent |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
示例
将设置值设置为“mouseup”:
js
function logResult(result) {
console.log(`设置已修改:${result}`);
}
browser.browserSettings.contextMenuShowEvent
.set({ value: "mouseup" })
.then(logResult);