9 |
9 |
10 import os |
10 import os |
11 import re |
11 import re |
12 import mimetypes |
12 import mimetypes |
13 |
13 |
14 from PyQt5.QtCore import ( |
14 from PyQt6.QtCore import ( |
15 QFile, QByteArray, QUrl, QCoreApplication, QBuffer, QIODevice |
15 QFile, QByteArray, QUrl, QCoreApplication, QBuffer, QIODevice |
16 ) |
16 ) |
17 from PyQt5.QtGui import QPixmap |
17 from PyQt6.QtGui import QPixmap |
18 |
18 |
19 |
19 |
20 WebBrowserDataDirectory = { |
20 WebBrowserDataDirectory = { |
21 "html": os.path.join(os.path.dirname(__file__), "..", "data", "html"), |
21 "html": os.path.join(os.path.dirname(__file__), "..", "data", "html"), |
22 "icons": os.path.join(os.path.dirname(__file__), "..", "data", "icons"), |
22 "icons": os.path.join(os.path.dirname(__file__), "..", "data", "icons"), |
232 agent string. |
232 agent string. |
233 |
233 |
234 @return tuple containing the Chrome version and the QtWebEngine version |
234 @return tuple containing the Chrome version and the QtWebEngine version |
235 @rtype tuple of str |
235 @rtype tuple of str |
236 """ |
236 """ |
237 from PyQt5.QtWebEngineWidgets import QWebEngineProfile |
237 from PyQt6.QtWebEngineWidgets import QWebEngineProfile |
238 |
238 |
239 useragent = QWebEngineProfile.defaultProfile().httpUserAgent() |
239 useragent = QWebEngineProfile.defaultProfile().httpUserAgent() |
240 match = re.search(r"""Chrome/([\d.]+)""", useragent) |
240 match = re.search(r"""Chrome/([\d.]+)""", useragent) |
241 chromeVersion = ( |
241 chromeVersion = ( |
242 match.group(1) |
242 match.group(1) |