Quick question - I'm trying to "deep link" to portable infobox tabs. That is, given a link like /wiki/Cairn#Displeased, it will navigate to the page Cairn and land on the infobox tab labeled Displeased. There was an extension we used on Fandom to do this (TabberLinks), but it doesn't seem to be on https://dev.miraheze.org (and it has some Fandom-specific dependencies anyway).
I was at one point, however, provided a code snippet that might work. Looking at this code snippet, would it do what I want it to accomplish? It doesn't seem to work right now, but I'm unsure if that's the cache or if the code is incorrect.
document.querySelectorAll('.portable-infobox .pi-tab-link, .portable-infobox .pi-section-tab').forEach(function(tab) {
var tabName = tab.textContent.trim();
infoboxTabs['#' + tabName] = tab;
});
if(typeof infoboxTabs[window.location.hash] !== 'undefined') {
setTimeout(function() {
infoboxTabs[window.location.hash].click();
}, 1);
}```
Links: [Common.js page](<https://dappervolk.miraheze.org/wiki/MediaWiki:Common.js>), [Example Page 1](<https://dappervolk.miraheze.org/wiki/Colorful_Stones#Jadeite>), [Example Page 2](<https://dappervolk.miraheze.org/wiki/Cairn#Pleased>).