The below fixes the elementorModules.frontend is undefined and then the autoparts works as expected..
function force_elementor_frontend_js_early()
{
if (defined(‘ELEMENTOR_VERSION’)) {
// Check if the user agent is Firefox
if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Firefox’) !== false) {
wp_deregister_script(‘elementor-frontend’);
wp_register_script(
‘elementor-frontend’,
ELEMENTOR_ASSETS_URL . ‘js/frontend.min.js’,
[‘jquery’],
ELEMENTOR_VERSION,
true
);
wp_enqueue_script(‘elementor-frontend’);
}
}
}
add_action(‘wp_enqueue_scripts’, ‘force_elementor_frontend_js_early’, 1);