2024-04-29 localhostを判定する js var uri = new URL(window.location.href); console.log(uri.hostname); if(uri.hostname=="localhost"){ }