Silence 'link preload' warning on the first card

Due to 207e425, a harmless warning about 'link preload' will be output
to the console on the first card.
This commit is contained in:
hikaru-y 2021-08-18 01:58:23 +09:00
parent 207e4253f1
commit dd9528aa73

View file

@ -106,6 +106,9 @@ class AnkiWebPage(QWebEnginePage):
if "MathJax localStorage" in buf: if "MathJax localStorage" in buf:
# silence localStorage noise # silence localStorage noise
return return
elif "link preload" in buf:
# silence 'link preload' warning on the first card
return
# ensure we don't try to write characters the terminal can't handle # ensure we don't try to write characters the terminal can't handle
buf = buf.encode(sys.stdout.encoding, "backslashreplace").decode( buf = buf.encode(sys.stdout.encoding, "backslashreplace").decode(
sys.stdout.encoding sys.stdout.encoding