This week was heavy from the dev side. As detailed in the last video update, I reworked the sourcebook parser quite a bit at the beginning of the week to address stalling or even halting imports. The other critical bug is the occasional reload of the Foundry VTT tab when clicking the browser's action button to actually connect to Foundry. The reload breaks the communication again and a vicious circle of not being able to use the tools follows.
I wasn't able to identify the root cause, as much as I tried. I still assume that it had to do with the way the content script is inserted into the Foundry VTT tab and that some kind of race condition then decides that a reload is in order to maintain stability - but I could be completely wrong.
When starting development on vtta.io earlier this year, Google already pushed their redesigned Chrome extension API, the manifest v3. I ultimatively decided to stick with v2, because at that time, documentation was mainly consisting out of dead links and I wanted to start on a solid understanding of the v2 version for the new extension.
The situation now, a couple of months later, changed for the better and I looked at the new way to write extensions again, trying to figure out if employing a service worker instead of a global background script would help me fixing this issue.
I first created a proof of concept with only the extension connecting to Foundry, then I started porting the individual parts responsible for handling the individual D&D Beyond content pages. And I did not only copy/paste old code, I refactored most of the code, cleaned up certain areas and made the extension more modularized and therefore (hopefully) easier to understand for other developers, as it will be the first component being released as open source.
Oh, and yes, this effort was not in vain. I am happy to say that I haven't had a single unwanted reload any longer, so this bug is not a bug any longer. This week was a good week, coding-wise.
To help people onboarding, I also created a "Getting Started" guide on vtta.io: https://www.vtta.io/articles/getting-started. It details all necessary steps to get going and it's worth a look. Please share this link for newer users to help them get ready to import stuff. Thanks!
Good night,
Sebastian
Brian Gackenbach
2021-07-29 22:11:30 +0000 UTC