liaowubinf
liaowubinf
I also encountered this problem, when will this issue be sloved? thanks!
> The api will be open source. When? A year has passed
> 参考文档:https://cefview.github.io/QCefView/zh/docs/reference/QCefView#class_q_cef_view_1a0aa0b257b5383428569d46c39d4003a2 > > https://cefview.github.io/QCefView/zh/docs/reference/QCefView#class_q_cef_view_1aff9055d5f9f773c2582c20b4bdf0cd33 这个只能阻断弹窗,如果是修改window.location.href这样的情况不会进入到这两个回调
> 看了一下相关提交,没有`onBeforeBrowser`接口。 是的, 我也没找到, 但最近接手的一个老项目, 里面的qcefview.h里面有这个 /// /// Gets called before the main browser redirect url /// /// /// /// /// /// virtual bool onBeforeBrowse(qint64 frameId, const std::string& url, const...
> 看了一下相关提交,没有`onBeforeBrowser`接口。 想问下没有这个onBeforeBrowse方法, 还有别的方式能拦截window.location.href这种redirect吗
> 先确认一下,你是使用的哪个仓库? https://github.com/CefView/CefViewCore/blob/fe335787e8ce5d9bf719617a248c5a9bf7e8e35c/include/CefViewBrowserClient.h#L367 > > https://github.com/winsoft666/QCefWidget/blob/3237d0165b51c60f8deb5e2919420d0a33ce50a1/src/QCefWidget/CefBrowserApp/QCefBrowserHandler.h#L256 仓库没错, 头文件就是跟这个仓库一样的,里面的用法也是QCefview, 但是之前有onBeforeBrowse, 升级dll后编译报错了
> > 想问下没有这个onBeforeBrowse方法, 还有别的方式能拦截window.location.href这种redirect吗 > > 可以参考文档,看哪个函数能够实现您的目的。感觉可以通过[addressChanged](https://cefview.github.io/QCefView/zh/docs/reference/QCefView/#class_q_cef_view_1a89ce3bc031d5dcd1115482118a6c4181)进行判断。 不行, adressChanged是 ed ,代表是改变之后的, 不能阻断redirect