When fetching a snapshot via Chrome, make the most recent screenshot available on the Diff and Preview pages (#516)

This commit is contained in:
dgtlmoon
2022-04-02 14:49:32 +02:00
committed by GitHub
parent ffd2a89d60
commit 9fe4f95990
15 changed files with 201 additions and 59 deletions

View File

@@ -1,6 +1,11 @@
// Rewrite this is a plugin.. is all this JS really 'worth it?'
if(!window.location.hash) {
var tab=document.querySelectorAll("#default-tab a");
tab[0].click();
}
window.addEventListener('hashchange', function() {
var tabs = document.getElementsByClassName('active');
while (tabs[0]) {
@@ -21,7 +26,6 @@ if (!has_errors.length) {
focus_error_tab();
}
function set_active_tab() {
var tab=document.querySelectorAll("a[href='"+location.hash+"']");
if (tab.length) {