CefView / QCefView

A Qt Widget encapsulated CEF view based on QWidget
https://cefview.github.io/QCefView/
GNU Lesser General Public License v2.1
527 stars 137 forks source link

[BUG]: OSR模式下,本地网页无法打开窗口且导致栈溢出 #240

Closed L-Super closed 1 year ago

L-Super commented 1 year ago

Describe the bug 【Bug描述】

本地网页js有以下函数

function setUserName() {
    let myName = prompt('请输入你的名字。');
    if(!myName) {
      setUserName();
    } else {
      localStorage.setItem('name', myName);
      myHeading.textContent = 'Mozilla 酷毙了,' + myName;
    }
  }

if (!localStorage.getItem('name')) {
    // setUserName();
} else {
    let storedName = localStorage.getItem('name');
    myHeading.textContent = 'Mozilla 酷毙了,' + storedName;
}
myButton.onclick = function () {
    setUserName();
}

用于打开一个JavaScript的prompt对话框,输入名字。但是在OSR模式下,无法打开对话框,且js栈溢出

Expected behavior 【正确的预期行为】

正常现象应为: image

Screenshots 【截图】

[0427/174458.541:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.541:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.542:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.542:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.542:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.543:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.543:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.543:ERROR:javascript_dialog_manager.cc(305)] Default dialog implementation requires a parent window handle; canceling the JS dialog
[0427/174458.545:INFO:CONSOLE(15)] "Uncaught RangeError: Maximum call stack size exceeded", source: file:///D:/CodeDemo/HTML/demo_site/scripts/main.js (15)

Environment 【BUG产生的环境】

Additional context 【更多额外信息】

NCW模式正常

tishion commented 1 year ago

你解决了吗

L-Super commented 1 year ago

你解决了吗

到目前为止,只遇到了这一次