Movatterモバイル変換


[0]ホーム

URL:


processExistingIframes(); } else { // DOM already ready - process immediately processExistingIframes(); } // Also process on load event (in case iframes are added very late) window.addEventListener('load', processExistingIframes, { once: true }); // Periodically check for new iframes (aggressive approach for third-party scripts) // This catches iframes that might be added after our initial scan let iframeCheckInterval = setInterval(function() { processExistingIframes(); // Stop checking after 10 seconds to avoid performance impact setTimeout(function() { clearInterval(iframeCheckInterval); }, 10000); }, 500); // Check every 500ms for first 10 seconds } // Monitor bfcache events to track cache status (only if debugging is enabled) if (ENABLE_BROADCAST_CHANNEL_DEBUG && window.performance && window.performance.getEntriesByType) { // Track when pages are restored from cache window.addEventListener('pageshow', function(event) { if (event.persisted) { // Page was restored from bfcache if (window.performance && window.performance.mark) { window.performance.mark('bfcache-restored'); } console.debug('[bfcache] Page restored from bfcache'); } else { // Page was loaded normally (not from cache) // This might indicate CacheFlushed happened console.debug('[bfcache] Page loaded normally - may have been evicted from cache'); } }); } // Remove any beforeunload and unload handlers that might block bfcache // beforeunload and unload are known bfcache blockers // Also wrap pagehide listeners to prevent errors from causing IgnoreEventAndEvict if (!window.__bfcacheEventListenerInterception) { window.__bfcacheEventListenerInterception = true; const originalAddEventListener = window.addEventListener; window.addEventListener = function(type, listener, options) { // Block unload and beforeunload listeners that block bfcache if (type === 'unload' || type === 'beforeunload') { if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Blocked ' + type + ' listener in main frame to enable bfcache'); } return; // Don't add the listener } // Wrap pagehide listeners to catch any errors that could cause IgnoreEventAndEvict if (type === 'pagehide') { const wrappedListener = function(event) { try { return listener.call(this, event); } catch (error) { // CRITICAL: Silently catch errors in pagehide handlers to prevent IgnoreEventAndEvict // Any uncaught error in pagehide can cause bfcache eviction if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Error in pagehide handler caught to prevent IgnoreEventAndEvict:', error); } // Don't rethrow - this prevents IgnoreEventAndEvict } }; return originalAddEventListener.call(this, type, wrappedListener, options); } return originalAddEventListener.call(this, type, listener, options); }; // Also intercept onunload and onbeforeunload property setters for main window try { // Intercept onunload let onunloadValue = null; Object.defineProperty(window, 'onunload', { get: function() { return onunloadValue; }, set: function(value) { // Silently ignore attempts to set onunload if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Blocked onunload property in main frame to enable bfcache'); } onunloadValue = null; // Don't store the value }, configurable: true }); // Intercept onbeforeunload let onbeforeunloadValue = null; Object.defineProperty(window, 'onbeforeunload', { get: function() { return onbeforeunloadValue; }, set: function(value) { // Silently ignore attempts to set onbeforeunload if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Blocked onbeforeunload property in main frame to enable bfcache'); } onbeforeunloadValue = null; // Don't store the value }, configurable: true }); } catch (e) { // Ignore errors if properties can't be intercepted if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Could not intercept onunload/onbeforeunload properties:', e); } } } // Wrap pagehide handler to prevent errors from causing IgnoreEventAndEvict // Errors in pagehide handlers are a common cause of IgnoreEventAndEvict window.addEventListener('pagehide', function(event) { // Only clean up if page is being cached (persisted = true means page will be cached) if (event.persisted) { // CRITICAL: Freeze all iframe navigation BEFORE cleanup to prevent SubframeIsNavigating // Set flag to prevent iframes from navigating during pagehide window.__bfcacheFreezeNavigation = true; // Use a try-catch wrapper around ALL cleanup to prevent IgnoreEventAndEvict // Even if individual cleanup steps fail, we don't want to throw try { // Close Kameleoon BroadcastChannel if (window.Kameleoon && window.Kameleoon.Internals && window.Kameleoon.Internals.runtime && window.Kameleoon.Internals.runtime.broadcastSynchranization && typeof window.Kameleoon.Internals.runtime.broadcastSynchranization.close === 'function') { window.Kameleoon.Internals.runtime.broadcastSynchranization.close(); if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Closed Kameleoon BroadcastChannel to enable bfcache'); } } // Close SharedWorker connections - SharedWorkers block bfcache // Note: We can't terminate SharedWorkers (they're shared across tabs), but we can close ports try { let closedCount = 0; // Close all tracked SharedWorker port connections if (window.__bfcacheSharedWorkers && Array.isArray(window.__bfcacheSharedWorkers)) { window.__bfcacheSharedWorkers.forEach(function(sw) { try { if (sw) { // Close the port connection (this disconnects this page from the SharedWorker) if (sw.port && typeof sw.port.close === 'function') { sw.port.close(); closedCount++; } // Also try to terminate if possible (though this may affect other tabs) // Only do this if the SharedWorker is only used by this page if (typeof sw.terminate === 'function') { try { sw.terminate(); closedCount++; } catch (e) { // Terminate might fail if other tabs are using it - that's okay } } } } catch (e) { // Ignore errors closing individual SharedWorker ports } }); } // Also try to close SharedWorker ports via known third-party globals try { // Check for SharedWorkers stored in common third-party locations const sharedWorkerPaths = [ window.klaviyo?.sharedWorker, window.__klaviyo?.sharedWorker, window.gorgias?.sharedWorker, window.__gorgias?.sharedWorker ]; sharedWorkerPaths.forEach(function(sw) { if (sw) { try { if (sw.port && typeof sw.port.close === 'function') { sw.port.close(); closedCount++; } // Try terminate as well if (typeof sw.terminate === 'function') { sw.terminate(); closedCount++; } } catch (e) { // Ignore errors } } }); } catch (e) { // Ignore errors accessing third-party globals } if (closedCount > 0 && ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Closed ' + closedCount + ' SharedWorker connection(s) to enable bfcache'); } } catch (swError) { // Silently handle SharedWorker cleanup errors if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Error closing SharedWorkers:', swError); } } // Close WebSocket connections (e.g., noibu) - WebSockets block bfcache try { let closedCount = 0; // CRITICAL: Close ALL WebSocket connections - regardless of state // Close ALL tracked WebSockets (even CLOSING/CLOSED to be safe) if (window.__bfcacheWebSockets && Array.isArray(window.__bfcacheWebSockets)) { window.__bfcacheWebSockets.forEach(function(ws) { try { if (ws && typeof ws.close === 'function') { ws.close(); // Close regardless of state closedCount++; } } catch (e) { // Ignore errors closing individual WebSockets } }); } // Aggressively search for and close WebSockets in third-party globals try { const noibuPaths = [window.noibu, window.__noibu, window._noibu]; noibuPaths.forEach(function(noibuObj) { if (noibuObj) { const wsProps = ['ws', 'socket', 'connection', 'websocket', 'webSocket', '_ws', '_socket']; wsProps.forEach(function(prop) { try { const ws = noibuObj[prop]; if (ws && typeof ws.close === 'function') { ws.close(); closedCount++; } } catch (e) { // Ignore } }); if (noibuObj.client) { wsProps.forEach(function(prop) { try { const ws = noibuObj.client[prop]; if (ws && typeof ws.close === 'function') { ws.close(); closedCount++; } } catch (e) { // Ignore } }); } } }); } catch (e) { // Ignore errors accessing third-party globals } if (closedCount > 0 && ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Closed ' + closedCount + ' WebSocket connection(s) to enable bfcache'); } } catch (wsError) { // Silently handle WebSocket cleanup errors if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Error closing WebSockets:', wsError); } } // CRITICAL: Remove ALL cross-origin iframes to prevent UnloadHandlerExistsInSubFrame // This is aggressive but necessary - we CANNOT remove unload handlers from cross-origin iframes // The ONLY solution is to remove the iframe entirely before pagehide try { const iframes = document.querySelectorAll('iframe'); let handlersRemoved = 0; let iframesRemoved = 0; // List of iframe sources we should KEEP (essential functionality) const essentialPatterns = [ 'youtube.com', 'youtu.be', 'vimeo.com', // Video players 'shopify.com', 'shopifyapps.com', // Shopify essential 'yotpo.com', // Reviews ]; iframes.forEach(function(iframe) { try { const iframeSrc = (iframe.src || '').toLowerCase(); // ALWAYS remove about:blank iframes - they cause IgnoreEventAndEvict if (!iframeSrc || iframeSrc === '' || iframeSrc === 'about:blank') { iframe.remove(); iframesRemoved++; return; } const isEssential = essentialPatterns.some(pattern => iframeSrc.includes(pattern)); // Try to access iframe window let canAccess = false; try { const iframeWindow = iframe.contentWindow; if (iframeWindow && iframeWindow.document) { canAccess = true; // Same-origin - remove handlers iframeWindow.onunload = null; iframeWindow.onbeforeunload = null; handlersRemoved++; // Apply interception if (!iframeWindow.__bfcacheIntercepted && iframeWindow.addEventListener) { const originalAddEventListener = iframeWindow.addEventListener; iframeWindow.addEventListener = function(type, listener, options) { if (type === 'unload' || type === 'beforeunload') { return; } return originalAddEventListener.call(this, type, listener, options); }; iframeWindow.__bfcacheIntercepted = true; } } } catch (e) { canAccess = false; } // If we can't access iframe (cross-origin), remove it unless essential if (!canAccess && !isEssential) { iframe.remove(); iframesRemoved++; } } catch (e) { // Error - remove iframe to be safe try { iframe.remove(); iframesRemoved++; } catch (e2) { // Ignore } } }); if ((handlersRemoved > 0 || iframesRemoved > 0) && ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Removed ' + handlersRemoved + ' unload handler(s) and ' + iframesRemoved + ' cross-origin iframe(s) to enable bfcache'); } } catch (iframeError) { // Silently handle iframe cleanup errors if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Error removing iframe unload handlers:', iframeError); } } // Close any open IndexedDB connections that might block bfcache if (ENABLE_BROADCAST_CHANNEL_DEBUG && window.indexedDB && window.indexedDB.databases) { window.indexedDB.databases().then(databases => { databases.forEach(db => { if (db.name) { // IndexedDB connections are automatically closed, but we can log them console.debug('[bfcache] IndexedDB database:', db.name); } }); }).catch(() => { // Ignore errors }); } // Mark page as successfully cached if (ENABLE_BROADCAST_CHANNEL_DEBUG && window.performance && window.performance.mark) { window.performance.mark('bfcache-cached'); } // Keep navigation frozen until page is fully cached // Don't unfreeze - let it stay frozen until page is restored } catch (error) { // CRITICAL: Silently handle ALL errors to prevent IgnoreEventAndEvict // Any uncaught error in pagehide can cause bfcache eviction // Don't rethrow, don't log to console (unless debugging), just swallow it if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Error during cleanup (swallowed to prevent IgnoreEventAndEvict):', error); } // Explicitly return to prevent any error propagation return; } } else { // Page is being unloaded but not cached // This might indicate CacheFlushed or other eviction if (ENABLE_BROADCAST_CHANNEL_DEBUG) { console.debug('[bfcache] Page unloaded but not cached - may have been evicted'); } // Unfreeze navigation if page isn't being cached window.__bfcacheFreezeNavigation = false; } }); // CRITICAL: Run cleanup on visibilitychange and beforeunload to catch navigation early // This ensures WebSockets and other resources are closed BEFORE pagehide function performBfcacheCleanup() { // Freeze navigation immediately window.__bfcacheFreezeNavigation = true; // Start continuous iframe removal - Signifyd may recreate iframes // Keep removing iframes every 10ms during navigation if (!window.__bfcacheIframeRemovalInterval) { window.__bfcacheIframeRemovalInterval = setInterval(function() { if (!window.__bfcacheFreezeNavigation) { clearInterval(window.__bfcacheIframeRemovalInterval); window.__bfcacheIframeRemovalInterval = null; return; } // Remove all non-essential iframes including about:blank iframes try { const iframes = document.querySelectorAll('iframe'); const essentialPatterns = ['youtube.com', 'youtu.be', 'vimeo.com', 'shopify.com', 'shopifyapps.com', 'yotpo.com']; iframes.forEach(function(iframe) { try { const iframeSrc = (iframe.src || '').toLowerCase(); // ALWAYS remove about:blank iframes - they cause IgnoreEventAndEvict if (!iframeSrc || iframeSrc === '' || iframeSrc === 'about:blank') { iframe.remove(); return; } const isEssential = essentialPatterns.some(function(pattern) { return iframeSrc.includes(pattern); }); if (!isEssential) { iframe.remove(); } } catch (e) { try { iframe.remove(); } catch (e2) {} } }); } catch (e) { // Ignore } }, 10); // Check every 10ms } try { // CRITICAL: Close ALL WebSockets immediately - regardless of state // Close ALL tracked WebSockets (even CLOSING/CLOSED to be safe) if (window.__bfcacheWebSockets && Array.isArray(window.__bfcacheWebSockets)) { window.__bfcacheWebSockets.forEach(function(ws) { try { if (ws && typeof ws.close === 'function') { // Close regardless of state - be aggressive ws.close(); } } catch (e) { // Ignore } }); } // Aggressively search for and close WebSockets in third-party globals try { // Check all possible noibu locations const noibuPaths = [ window.noibu, window.__noibu, window._noibu ]; noibuPaths.forEach(function(noibuObj) { if (noibuObj) { // Check all possible WebSocket property names const wsProps = ['ws', 'socket', 'connection', 'websocket', 'webSocket', '_ws', '_socket']; wsProps.forEach(function(prop) { try { const ws = noibuObj[prop]; if (ws && typeof ws.close === 'function') { ws.close(); } } catch (e) { // Ignore } }); // Also check nested objects try { if (noibuObj.client) { wsProps.forEach(function(prop) { try { const ws = noibuObj.client[prop]; if (ws && typeof ws.close === 'function') { ws.close(); } } catch (e) { // Ignore } }); } } catch (e) { // Ignore } } }); } catch (e) { // Ignore } // Also try to find WebSockets by searching window properties (last resort) // This is expensive but necessary if WebSockets are hidden try { for (let key in window) { try { const obj = window[key]; if (obj && typeof obj === 'object') { // Check if it's a WebSocket if (obj.readyState !== undefined && typeof obj.close === 'function' && (obj.readyState === WebSocket.OPEN || obj.readyState === WebSocket.CONNECTING)) { obj.close(); } // Also check for WebSocket properties if (obj.ws && typeof obj.ws.close === 'function') { obj.ws.close(); } if (obj.socket && typeof obj.socket.close === 'function') { obj.socket.close(); } } } catch (e) { // Ignore - might be non-enumerable or throw } } } catch (e) { // Ignore } // Close SharedWorker ports immediately if (window.__bfcacheSharedWorkers && Array.isArray(window.__bfcacheSharedWorkers)) { window.__bfcacheSharedWorkers.forEach(function(sw) { try { if (sw && sw.port && typeof sw.port.close === 'function') { sw.port.close(); } } catch (e) { // Ignore } }); } // CRITICAL: Remove ALL iframes that we can't fully control // This is aggressive but necessary to prevent UnloadHandlerExistsInSubFrame // Cross-origin iframes can have unload handlers we cannot remove try { const iframes = document.querySelectorAll('iframe'); iframes.forEach(function(iframe) { try { const iframeWindow = iframe.contentWindow; const iframeSrc = (iframe.src || '').toLowerCase(); // ALWAYS remove about:blank iframes - they cause IgnoreEventAndEvict if (!iframeSrc || iframeSrc === '' || iframeSrc === 'about:blank') { iframe.remove(); return; } // List of iframe sources we should KEEP (essential functionality) // Everything else gets removed during navigation const essentialPatterns = [ 'youtube.com', 'youtu.be', 'vimeo.com', // Video players 'shopify.com', 'shopifyapps.com', // Shopify essential 'yotpo.com', // Reviews (if needed) ]; const isEssential = essentialPatterns.some(pattern => iframeSrc.includes(pattern)); // Try to access iframe window let canAccess = false; try { if (iframeWindow && iframeWindow.document) { canAccess = true; } } catch (e) { canAccess = false; } if (canAccess) { // Same-origin iframe - remove handlers try { iframeWindow.onunload = null; iframeWindow.onbeforeunload = null; // Apply interception if (!iframeWindow.__bfcacheIntercepted && iframeWindow.addEventListener) { const originalAddEventListener = iframeWindow.addEventListener; iframeWindow.addEventListener = function(type, listener, options) { if (type === 'unload' || type === 'beforeunload') { return; } return originalAddEventListener.call(this, type, listener, options); }; iframeWindow.__bfcacheIntercepted = true; } } catch (e) { // Can't remove handlers - remove iframe if not essential // DON'T set src to about:blank - that causes SubframeIsNavigating if (!isEssential) { iframe.remove(); } } } else { // Cross-origin iframe - we CANNOT remove unload handlers // The ONLY solution is to remove the iframe entirely // DON'T set src to about:blank - that causes SubframeIsNavigating if (!isEssential) { iframe.remove(); } } } catch (e) { // Error accessing iframe - remove it to be safe // DON'T set src - just remove try { iframe.remove(); } catch (e2) { // Ignore } } }); } catch (e) { // Ignore } } catch (e) { // Ignore all errors } } // CRITICAL: Block Signifyd and other problematic iframes from being created during navigation // Signifyd specifically creates iframes with unload handlers that block bfcache (function() { // Monitor for Signifyd iframes and remove them immediately during navigation if (window.MutationObserver) { const iframeBlockerObserver = new MutationObserver(function(mutations) { // Only block during navigation if (!window.__bfcacheFreezeNavigation) return; mutations.forEach(function(mutation) { mutation.addedNodes.forEach(function(node) { if (node.nodeType === 1) { // Check if it's an iframe if (node.tagName && node.tagName.toLowerCase() === 'iframe') { // Remove immediately during navigation node.remove(); } // Also check for iframes within the added node if (node.querySelectorAll) { const iframes = node.querySelectorAll('iframe'); iframes.forEach(function(iframe) { iframe.remove(); }); } } }); }); }); // Start observing when DOM is ready function startIframeBlocker() { if (document.body) { iframeBlockerObserver.observe(document.body, { childList: true, subtree: true }); } } if (document.body) { startIframeBlocker(); } else { document.addEventListener('DOMContentLoaded', startIframeBlocker); } } // Also intercept createElement to block iframe creation during navigation const originalCreateElement = document.createElement; document.createElement = function(tagName, options) { const element = originalCreateElement.call(this, tagName, options); // If navigation is frozen, don't allow iframe creation if (window.__bfcacheFreezeNavigation && tagName.toLowerCase() === 'iframe') { // Return a div instead of iframe to prevent unload handlers return originalCreateElement.call(this, 'div', options); } return element; }; })(); // Run cleanup on visibilitychange (page becomes hidden) // This fires BEFORE pagehide and gives us more time // NOTE: We use visibilitychange instead of beforeunload because beforeunload blocks bfcache if (document.visibilityState !== undefined) { document.addEventListener('visibilitychange', function() { if (document.visibilityState === 'hidden') { // Freeze navigation FIRST to block new iframes window.__bfcacheFreezeNavigation = true; performBfcacheCleanup(); } }, { capture: true }); } // NOTE: We do NOT add a beforeunload listener here because it blocks bfcache // Instead, we rely on visibilitychange and pagehide events which don't block bfcache // Unfreeze navigation when page is restored from cache window.addEventListener('pageshow', function(event) { if (event.persisted) { // Page was restored from cache - unfreeze navigation window.__bfcacheFreezeNavigation = false; } }); // CRITICAL: Ensure page is marked as fully loaded to prevent "page did not finish loading" errors // This must happen for ALL pages, not just in debug mode // The browser checks if the page finished loading before allowing bfcache (function() { function markPageAsReady() { // Mark page as fully loaded if (window.performance && window.performance.mark) { window.performance.mark('page-ready-for-bfcache'); } // Set a flag that page is ready window.__bfcachePageReady = true; // Use Performance API to mark page as interactive/complete // This helps the browser understand the page is ready if (window.performance && window.performance.timing) { // Mark navigation timing as complete try { if (window.performance.timing.loadEventEnd === 0) { // Load event hasn't fired yet, but we're marking as ready anyway // This is a workaround for pages with slow-loading resources } } catch (e) { // Ignore } } } // Mark as ready immediately if page is already loaded if (document.readyState === 'complete') { markPageAsReady(); } else if (document.readyState === 'interactive') { // Page is interactive - mark as ready now (don't wait for load event) // This is important because some pages never fire the load event due to // third-party scripts or slow-loading resources markPageAsReady(); // Also listen for load event as confirmation window.addEventListener('load', markPageAsReady, { once: true }); } else { // Page is still loading // Mark as ready on DOMContentLoaded (page structure is ready) document.addEventListener('DOMContentLoaded', markPageAsReady, { once: true }); // Also mark on load event window.addEventListener('load', markPageAsReady, { once: true }); } // CRITICAL: Aggressive fallback - mark as ready after DOMContentLoaded + short delay // This ensures pages are marked as ready even if load event never fires // (which can happen with third-party scripts or slow resources) document.addEventListener('DOMContentLoaded', function() { // Wait a short time after DOMContentLoaded, then mark as ready // This gives time for critical resources but doesn't wait forever setTimeout(function() { if (!window.__bfcachePageReady) { markPageAsReady(); } }, 100); // 100ms after DOMContentLoaded - very short delay }, { once: true }); // Additional fallback: Mark as ready after a maximum delay // This is a safety net for pages that never fully load setTimeout(function() { if (!window.__bfcachePageReady) { markPageAsReady(); } }, 2000); // 2 seconds max - mark as ready even if load event never fires // Also mark as ready when page becomes visible (if it wasn't already) // This handles cases where page loads in background tab if (document.visibilityState !== undefined) { document.addEventListener('visibilitychange', function() { if (document.visibilityState === 'visible' && !window.__bfcachePageReady) { // Page became visible - if DOM is ready, mark as ready if (document.readyState !== 'loading') { markPageAsReady(); } } }); } })(); // CRITICAL: Intercept navigation to ensure page is marked as ready before navigation // This prevents "page did not finish loading" errors (function() { if (!window.__bfcacheNavigationInterception) { window.__bfcacheNavigationInterception = true; // Intercept pushState and replaceState to mark page as ready before navigation const originalPushState = history.pushState; const originalReplaceState = history.replaceState; history.pushState = function() { // Ensure page is marked as ready before navigation if (!window.__bfcachePageReady && document.readyState !== 'loading') { window.__bfcachePageReady = true; if (window.performance && window.performance.mark) { window.performance.mark('page-ready-for-bfcache'); } } return originalPushState.apply(this, arguments); }; history.replaceState = function() { // Ensure page is marked as ready before navigation if (!window.__bfcachePageReady && document.readyState !== 'loading') { window.__bfcachePageReady = true; if (window.performance && window.performance.mark) { window.performance.mark('page-ready-for-bfcache'); } } return originalReplaceState.apply(this, arguments); }; // Also intercept link clicks to mark page as ready document.addEventListener('click', function(e) { const link = e.target.closest('a'); if (link && link.href && !link.href.startsWith('#"Color, Colour", addToCart: "Add to Cart", estimateShipping: "Estimate shipping", noShippingAvailable: "We do not ship to this destination.", free: "Free", from: "From", preOrder: "Pre-order", soldOut: "Sold Out", sale: "Sale", subscription: "Subscription", unavailable: "Unavailable", unitPrice: "Unit price", unitPriceSeparator: "per", stockout: "All available stock is in cart", products: "Products", pages: "Pages", collections: "Collections", resultsFor: "Results for", noResultsFor: "No results for", articles: "Articles", successMessage: "Link copied to clipboard", }, settings: { badge_sale_type: "dollar", animate_hover: true, animate_scroll: true, show_locale_desktop: null, show_locale_mobile: null, show_currency_desktop: null, show_currency_mobile: null, currency_select_type: "currency", currency_code_enable: true, cycle_images_hover_delay: 1.5, free_shipping_limit_ca: "", enable_lazy_loading: true }, info: { name: 'pipeline' }, version: '7.0.2', moneyFormat: "${{amount}}", shopCurrency: "USD", currencyCode: "USD" } // Set viewport height CSS variables let windowInnerHeight = window.innerHeight; document.documentElement.style.setProperty('--full-screen', `${windowInnerHeight}px`); document.documentElement.style.setProperty('--three-quarters', `${windowInnerHeight * 0.75}px`); document.documentElement.style.setProperty('--two-thirds', `${windowInnerHeight * 0.66}px`); document.documentElement.style.setProperty('--one-half', `${windowInnerHeight * 0.5}px`); document.documentElement.style.setProperty('--one-third', `${windowInnerHeight * 0.33}px`); document.documentElement.style.setProperty('--one-fifth', `${windowInnerHeight * 0.2}px`); window.isRTL = document.documentElement.getAttribute('dir') === 'rtl'; // IE11 polyfill check if (window.MSInputMethodContext && document.documentMode) { var scripts = document.getElementsByTagName('script')[0]; var polyfill = document.createElement('script'); polyfill.defer = true; polyfill.src = "//www.dcshoes.com/cdn/shop/t/346/assets/ie11.js?v=144489047535103983231770308458"; scripts.parentNode.insertBefore(polyfill, scripts); } // Cart initialization (function () { function onPageShowEvents() { if ('requestIdleCallback' in window) { requestIdleCallback(initCartEvent, { timeout: 500 }); } else { initCartEvent(); } function initCartEvent() { window .fetch(window.theme.routes.cart + '.js') .then((response) => { if (!response.ok) { throw { status: response.statusText }; } return response.json(); }) .then((response) => { document.dispatchEvent( new CustomEvent('theme:cart:change', { detail: { cart: response, }, bubbles: true, }) ); return response; }) .catch((e) => { console.error('theme-scripts: Error initializing cart event:', { error: e?.message || e?.status || e, status: e?.status, stack: e?.stack, fullError: e }); }); } } window.onpageshow = onPageShowEvents; })(); // Additional functionality document.addEventListener('DOMContentLoaded', event => { let setcart = localStorage.getItem('setcart'); if (setcart == 1) { console.log('setcart 1'); setTimeout(function () { localStorage.removeItem('setcart'); document.querySelector('[data-drawer-toggle="drawer-cart"]').click(); }, 500); } }); function toggleGWPList() { const GWPList = document.getElementById('gwp-option-list'); GWPList.classList.toggle('show'); const GWPPreview = document.getElementById('cart-gwp-gwp-preview'); GWPPreview.classList.toggle('hide'); }Skip to content

PREZ DAY SALE    Extra 20% Off Sale   Shop Now

Your order qualifies for free shippingFREE SHIPPING WITH MEMBERSHIP Spend $100.00 USD more for free shipping

Shop Now. Pay with Klarna.

DC Shoes

PREZ DAY SALE

20% OFF SALE STYLES

Save even more on existing markdowns

Code:EXTRA20

Diamond plate pattern on a metal surface

SALE STYLES

(RE)INTRODUCING:

AT-2

WARNING: Aerotech Ventilation System may cause increased cooling.

Gray and green sneaker on a black background with abstract designs
Gray and green sneaker on a black background with abstract designs

Person snowboarding off a rail with a snowy landscape and blue sky in the background

SNOW SHOP

WINTER SPORT ESSENTIALS

Show off your competitive streak

Gold sneakers on a gray surface with a neutral background

RED, WHITE & BLUE

AMERICANA CLASSICS

Embrace the spirit of the season

FEATURED

Currency

Follow Us

Facebook (opens in new tab)Twitter (opens in new tab)Pinterest (opens in new tab)Instagram (opens in new tab)
Privacy Policy Terms & Conditions Mobile Alerts Policy Do Not Sell of Share My Personal Information Accessibility Statement Accessibility Toolbar

DC Shoes™ is a trademark of DC Shoes, Inc. ©2025 DC Shoes, Inc. All Rights Reserved.

 
This website uses cookies to ensure you get the best experience
 
 

Your Privacy Choices

On this website, we use cookies and similar tracking technologies, and allow our advertising partners to use such technologies, so we can, among other things, show you ads promoting DC Shoes on other sites and services. These activities may be considered “sales,” “sharing,” or “targeted advertising” under certain privacy laws.

 

To opt out, slide the toggle below to “off” and then click “Confirm My Choices.” Note that you will need to renew this opt-out choice if you visit our website from another device or browser or if you clear your cookies. You can also opt out by visiting our website with a legally-recognized opt-out preference signal, such as the Global Privacy Control.

 

In addition to cookie-based ad targeting, we may disclose certain personal information, such as your email address and purchase information, to our affiliates, and advertising partners for marketing and advertising purposes. You may opt out of these disclosures by submitting thisOpt-Out Form.


For more information about our privacy practices, please see ourPrivacy Policy.

 
Enable Targeting Cookies:

[8]ページ先頭

©2009-2026 Movatter.jp