Window.onload function not working in Firefox

Hello!
This week I launched my first client-project.
But there’s one bug that’s been bothering me and I can’t find the solution.

When using CustomCode my Finsweet CMS sort doesn’t seem to work (on firefox).
And it seems pretty unstable with chrome (from time to time)

<script>
window.onload=function(){
document.querySelector(".fs_cmssort_button").click();
};
</script>

Any idea what might be the problem.

Link to site


Here is my site Read-Only: [LINK][1]