perf: 修复 Chrome 执行脚本失败,页面卡在进度条界面的问题

This commit is contained in:
Eric
2023-08-16 16:18:53 +08:00
committed by Bryan
parent d02cbcc3a3
commit 8f10b84e94
4 changed files with 10 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import subprocess
import sys
import time
from subprocess import CREATE_NO_WINDOW
from threading import Thread
_blockInput = None
_messageBox = None
@@ -36,7 +37,10 @@ def unblock_input():
def notify_err_message(msg):
if _messageBox:
_messageBox(msg, 'Error')
# _messageBox 是阻塞当前线程的,所以需要开启一个新线程执行
t = Thread(target=_messageBox, args=(msg, 'Error'), kwargs={})
t.daemon = True
t.start()
def decode_content(content: bytes) -> str: