사용자가 창을 닫기 전에 데이터를 저장하십시오

window.onbeforeunload = function (e) {
   // return a string if you don't want to close
   // the returned string will be displayed in the browser
   return "Do not close please!";

  // return undefined to close the TAB
  return;
};

좋은 웹페이지 즐겨찾기