Skip to content

Commit

Permalink
[Log Form] Fix issue in FF
Browse files Browse the repository at this point in the history
If FF loads the page from browser cache then it is already fully loaded when the observing starts and thus the observer callback isn't called.
To circumvent this, we add a dummy element (and immediately remove it) to force a call to the observer callback.
Note that in Chrome or if one forces a page reload from the server this isn't an issue.
  • Loading branch information
DieBatzen committed Jan 5, 2024
1 parent 5eb3f64 commit 0244c9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gc_little_helper_II.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5473,6 +5473,10 @@ var mainGC = function() {
observer.observe(document.body, config);
});
logviewObserver.observe(document.body, config);
// Safeguard: if FF loads the page from browser cache then it is already fully loaded at this point,
// therefore add a dummy element (and immediately remove it) to force a call to the observer callback.
// In Chrome or if one forces a page reload from the server this isn't an issue.
$('body').append('<div id="gclh_dummy"></div>'); $('div#gclh_dummy').remove();
}

// Improve Mail.
Expand Down

0 comments on commit 0244c9e

Please sign in to comment.