cef

1. 删除cef3浏览器的右键菜单

// client_handler.cpp

void ClientHandler::OnBeforeContextMenu(
    CefRefPtr<CefBrowser> browser,
    CefRefPtr<CefFrame> frame,
    CefRefPtr<CefContextMenuParams> params,
    CefRefPtr<CefMenuModel> model) {
        model->Clear();
        return;
}
View Code

2. 禁止cef3浏览器鼠标形状变化

  当网页加载完毕后,将鼠标放在超链接上,鼠标会变成小手型状。如果你不希望它变化,想让鼠标一直显示箭头的形状则可以将参数(mouse_cursor_change_disabled_)设置为true,不过我个人一般是设置为false。

// client_handler.cpp

ClientHandler::ClientHandler()
  : browser_id_(0),
    is_closing_(false),
    main_handle_(NULL),
    edit_handle_(NULL),
    back_handle_(NULL),
    forward_handle_(NULL),
    stop_handle_(NULL),
    reload_handle_(NULL),
    focus_on_editable_field_(false) {
#if defined(OS_LINUX)
  gtk_dialog_ = NULL;
#endif

  // Read command line settings.
  CefRefPtr<CefCommandLine> command_line =
      CefCommandLine::GetGlobalCommandLine();

  if (command_line->HasSwitch(cefclient::kUrl))
    startup_url_ = command_line->GetSwitchValue(cefclient::kUrl);
  if (startup_url_.empty())
    //startup_url_ = "http://www.google.com/";
    startup_url_ = "http://www.baidu.com/";

  mouse_cursor_change_disabled_ = true;     // 禁止鼠标形状变化
  // mouse_cursor_change_disabled_ = false; // 运行鼠标形状变化。我一般都设置为false,这样鼠标放到带url的文字上会变成手型
}
View Code

 

test:

http://microlink.im/x.html

http://tests/window

http://localhost/test2.php   http://localhost/test2.html

http://localhost/window.html

http://localhost/window-31.html

http://localhost/window-32.html

转载于:https://www.cnblogs.com/hezhixiong/p/4795119.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值