
//웹 브라우저에서 알림 기능을 지원하는지 확인
if('Notification' in window){
console.log('지원함');
//알림 기능을 브라우저가 지원하면, 권한을 요청
Notification.requestPermission().then(permission => {
console.log(permission);
});
}else{
console.log('지원 안함');
}
notiBtn.addEventListener("click", () => {
const notification = new Notification("제목", {body: "내용"});
})


Notification 함수에 이미지 혹은 아이콘을 추가해 예쁘게 꾸며줄 수도 있다.
click 이벤트를 추가해서 알림을 누르면 등록된 링크로 이동하는 것도 가능하다.
const start = document.querySelector("#start");
start.addEventListener("click", () =>{
console.log("start");
window.navigator.mediaDevices.getUserMedia({video:true});
});
