SOURCE

window.onload = () => {
    if(navigator.userAgent.match(/(iPhone|iPad|iPod|iOS)/i) || navigator.userAgent.match(/Android/i)){
            console.log('mobile!');
        }
        else
        {
             console.log('PC!');
        }
}
console 命令行工具 X clear

                    
>
console