I've been trying to fix problems relating to <tabview> removing a lot of attributes relating to the pages it imports.
So far, I've managed to fix portable infoboxes and galleries by importing the CSS for them in site CSS, but I can't think of anything to fix collapsible tables.
Specifically, the button used to expand/collapse the table just... doesn't exist.
Example page: https://bee-swarm-simulator.fandom.com/wiki/Robo_Bear_Challenge
From what I can see in Chrome DevTools, it seems like the table is missing some classes and attributes.
I tried injecting the missing classes and attributes, but they still don't seem to work (unless I'm doing it wrong, which I probably am). I also tried doing the same thing I did with the infoboxes and galleries - importing the JS code for <tabview> via site JS - but that also didn't work. (Maybe I imported the wrong JS code? I don't know.)
So instead, I tried to find a way to force the table to expand (which is an ugly solution, but it's better than nothing).
The way <tabview> works is that it only loads the pages after you click on the tab, so I have to somehow detect when the page loads, and then remove the "mw-collapsed" class from the table.
I tried:
detecting whenever an element with the "tabContent" class (which covers the page's content) loads, but that didn't seem to work.
detecting whenever a tab is clicked, but the page doesn't load immediately so that didn't work. (I could add a timeout, but I don't like that solution since if a page takes extra time to load for any reason then the solution is dead in the water.)
adding a 100ms interval to remove the class works, but is a rather costly solution that I'd like to avoid.
The only thing I thought of but haven't tried is detecting when an element is added to the container, but to be honest, I don't know how I'm supposed to do that. I tried searching StackOverflow, but the solutions were... confusing to say the least.
Is there a better solution to remove the "mw-collapsed" class, or is there one that fixes the button completely?