Thread:Ckwng/@comment-26154973-20160321115500

About your issue in the to-do list, here is a working (?) example I got:

function getQuery { var query = {}; for (var part of window.location.search.substring(1).split("&")) { var kv = part.split("="); if (kv.length === 2) { query[kv[0]] = kv[1]; }   }    return query; }

(function(mw, $) {

"use strict";

$(document).ready(function {

function scrollTo(content, selector) { var element = content.find(selector).get(0); if (element) { element.scrollIntoView; }       }

var initial_hash = window.location.hash && window.location.hash !== "" ? window.location.hash : true, initial_tab = getQuery.tab, switch_hash = null, outer_element = $(initial_hash).get(0);

function switchToTab(tab, hash) { $("ul.tabs li a span:contains('" + tab + "')").parent.trigger("click"); switch_hash = hash; }

function processTabBody(content) { var $content = $(content); if ($content.attr("class") === "tabBody selected") { $content.ready(function {

if (initial_hash) { if (initial_tab) { switchToTab(initial_tab, initial_hash); initial_tab = null; } else { if (!outer_element) { scrollTo($content, initial_hash); }                           initial_hash = null; }                   } else { if (switch_hash) { scrollTo($content, switch_hash); switch_hash = null; }                   }

$content.find(".tabview_link a").each(function {                       $(this).click(function(link_element) { link_element.preventDefault; var href = $(this).attr("href"), parts = href.split("/").pop.split("#"), tab = parts[0], hash = "#" + parts[1]; window.location.hash = hash; switchToTab(tab, hash); scrollTo($(".tabBody.selected"), hash); });                   });

});           }        }

mw.hook("wikipage.content").add(processTabBody);

});

}(mediaWiki, jQuery));

Using Sandbox/Quests as an example, it should:
 * Scroll to A14 on Sandbox/Quests, but not for Sandbox/Quests, because there is an element with id="A20" outside tabview.
 * Switch to Modernization tab and scroll to G3 on Sandbox/Quests?tab=Modernization, but just switch to Modernization tab on Sandbox/Quests?tab=Modernization (again, there is an element with id="G2" outside).
 * Template:QuestLink used in Modernization tab, so because of tabview_link class it should switch tabs and/or scroll correctly when you click on links (there are two cases: when other tab isn't loaded yet or when it's already loaded).

May need some more testing / have some edge cases. 