Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: OSR模式下调用js的alert函数报错,但是NCW模式下就没事 #448

Open
StackExplode opened this issue Oct 28, 2024 · 0 comments

Comments

@StackExplode
Copy link

Describe the bug 【Bug描述】

OSR模式下无法调用js的alert函数,报错:

[1028/105737.747:ERROR:javascript_dialog_manager.cc(332)] Default dialog implementation requires a parent window handle; canceling the JS dialog

我已经在新建QCefView的时候指定了parent,为啥还不行?

QCefView* bro = new QCefView("", &setting, this); //放在了Mainwindow的构造函数里,this指的是Mainwindow
this->setCentralWidget(bro);
bro->navigateToUrl(url);

To Reproduce 【复现步骤】

  1. 用OSR模式设置
  2. 按上述代码新建QCefView
  3. 试图在网页中调用alert
  4. QTCreator下方程序输出中提示报错,且无alert弹出
  5. 切换回NCW模式就正常了

Expected behavior 【正确的预期行为】

...

Screenshots 【截图】

...

Environment 【BUG产生的环境】

  • OSR/NCW Mode:OSR
  • OS & Version: Windows10 x64
  • Qt Version: 5.13.1
  • CEF Version: cef_binary_127.3.5+g114ea2a+chromium-127.0.6533.120_windows64

Additional context 【更多额外信息】

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant