(() => { //window.addEventListener('error', function(e) { // console.log('================ ERROR DETAIL ================'); // console.log('message : ', e.message); // console.log('source : ', e.filename); // console.log('line : ', e.lineno); // console.log('column : ', e.colno); // console.log('error : ', e.error); //}); //window.addEventListener('unhandledrejection', function(e) { // console.log('================ PROMISE ERROR ================'); // console.log('reason = ', e.reason); // if ( e.reason ) { // console.log('message = ', e.reason.message); // console.log('stack = ', e.reason.stack); // } //}); const { EventManager, utils } = ShopbySkin; const { isMobileDevice } = utils; // 외부스크립트 등록 기능. 삭제금지 ShopbyExternalScript?.initialize({ apiOption: { platform: 'MOBILE_WEB', }, }).then(() => { EventManager.fire('QUERY_PAGE_SCRIPTS', ShopbyExternalScript?.scripts); }); EventManager.on('PAGE_LOAD_COMPLETED', ({ profile }) => { // 외부스크립트 등록 기능. 삭제금지 ShopbyExternalScript?.setGlobalObjectSb({ getPlatform: () => (isMobileDevice ? 'MOBILE_WEB' : 'PC'), profile, }); if ( profile != null ){ //console.log(`email : ${profile.email}\nmemberId : ${profile.memberId}\nmemberName : ${profile.memberName}\nmobileNo : ${profile.mobileNo}\nproviderType : ${profile.providerType}`); const providerType = profile.providerType; if ( providerType != null ){ localStorage.setItem('providerType', providerType); } else { localStorage.removeItem('providerType'); } } else { //localStorage.removeItem('providerType'); } }); const searchParams = new URLSearchParams(location.search); const trackingKey = searchParams.get('trackingKey'); const channelType = searchParams.get('channelType'); const { setTrackingKey, setChannelType } = ShopbySkin.utils; setTrackingKey(trackingKey); setChannelType(channelType); /** * 검색 리스트 상태(localStorage) 유지 범위 제어 * - product-list / product-detail 에서만 유지 * - 그 외 모든 페이지 진입 시 초기화 * - /mobile/modals/search-keyword.js 이 페이지에 로컬스토리지 초기화 추가 * (2026-02-04) */ const HTML_KEY = "shopby_html"; const SCROLL_KEY = "shopby_scrollY"; const TIME_KEY = "shopby_savedAt"; const CONTEXT_KEY = "shopby_list_context"; const path = location.pathname; const isProductList = path.includes("product-list"); const isProductDetail = path.includes("product-detail"); const isAllowPage = isProductList || isProductDetail; if (!isAllowPage) { localStorage.removeItem(HTML_KEY); localStorage.removeItem(SCROLL_KEY); localStorage.removeItem(TIME_KEY); localStorage.removeItem(CONTEXT_KEY); console.log("[DEBUG] 검색 유지 제외 페이지 → 로컬스토리지 초기화", path); } else { console.log("[DEBUG] 검색 유지 허용 페이지", path); } })();