how to prevent switch to opener tab on js window.opener reload in firefox

When reloading opener window in JavaScript this way:

window.opener.location.href = window.opener.location.href;

The opener tab gets focused in Firefox and this is undesirable. I don’t get this behavior in Chrome. It may be due to a Firefox update because this is an old system and this problem is not reported previously.

Answer

This is https://bugzilla.mozilla.org/show_bug.cgi?id=1694927 which is fixed in Firefox 87.