From 0d3bc2585e6634f50c91e2674f0f6bcfcb231902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BA=A2=E5=B2=A9?= Date: Tue, 26 Mar 2024 15:22:53 +0800 Subject: [PATCH] U: energy custom menu modify --- cef/chromium_callback.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cef/chromium_callback.go b/cef/chromium_callback.go index 7fb5ef4e..b63a0138 100644 --- a/cef/chromium_callback.go +++ b/cef/chromium_callback.go @@ -181,11 +181,11 @@ func chromiumOnBeforeContextMenu(window IBrowserWindow, browser *ICefBrowser, fr model.AddSeparator() } //A标签和图片 链接 - if params.TypeFlags() == 5 && params.MediaType() == consts.CM_MEDIATYPE_NONE { //a=5 + if params.MediaType() == consts.CM_MEDIATYPE_NONE { //a=5 aUrlId = model.CefMis.NextCommandId() model.AddItem(aUrlId, i18n.Resource("copyLink")) } - if params.TypeFlags() == 9 && params.MediaType() == consts.CM_MEDIATYPE_IMAGE { // image=9 + if params.MediaType() == consts.CM_MEDIATYPE_IMAGE { // image=9 //copyImageId = model.CefMis.NextCommandId() //model.AddItem(copyImageId, "复制图片") imageUrlId = model.CefMis.NextCommandId() @@ -193,7 +193,7 @@ func chromiumOnBeforeContextMenu(window IBrowserWindow, browser *ICefBrowser, fr imageSaveId = model.CefMis.NextCommandId() model.AddItem(imageSaveId, i18n.Resource("imageSaveAs")) } - if (params.TypeFlags() == 5 && params.MediaType() == consts.CM_MEDIATYPE_NONE) || params.TypeFlags() == 9 && params.MediaType() == consts.CM_MEDIATYPE_IMAGE { + if params.MediaType() == consts.CM_MEDIATYPE_NONE || params.MediaType() == consts.CM_MEDIATYPE_IMAGE { model.AddSeparator() } backId = model.CefMis.NextCommandId()