Answer the question
In order to leave comments, you need to log in
How to execute a page script in Firefox when opening it in an adjacent tab?
There is an HTML page in the "Head" of which the script is standardly connected: .
Its code, as expected, is always executed when the page is loaded. Tested in Chrome, Edge, IE11 and Mozilla. But the latter, and only the latter, had an incomprehensible feature: when you open a page in an adjacent tab (for example, by pressing the wheel), the page opens as if this script was not registered on it. Just nothing happens. When the page is reloaded, of course, everything works as it should.
I can assume that the point is that this entire script is wrapped as follows:<script src="../js/ready.js"></script>
(function () {
Содержимое...
})();
function ContentVerification() {
if ($('#content > p').text() == 'Попытка загрузить инструкцию...') {
window.location.reload();
}
}
$(window).focus(function() {
if ($('#content > p').text() == 'Попытка загрузить инструкцию...') {
setTimeout(ContentVerification, 500);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question