How can I generate a lighthouse report for my card template?

you can’t really use lighthouse inside anki like this, because it treats the webview like a regular webpage when Anki performs things differently to display the front or back side of a card. I’m guessing that when emulating the page load, lighthouse doesn’t have a way to tell Anki to populate the #qa element and thus it’s empty.

Alternatively, you can try pulling out your card template into a HTML file and use chrome devtools from there. Though, this doesn’t reflect everything that Anki has does when displaying. e.g. you miss out on Anki desktop’s default styles injected in <head> and <body>. And how MathJax is loaded to render math. And apparently JQuery and Fabric which I have no idea what it’s used for. Oh and pycmd isn’t available too.

I think you can skip trying to use lighthouse for the moment. if you’re still adamant, try to grok it and solve the issue.

1 Like