<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="preconnect" href="https://img.icraftstories.com" crossorigin> <link rel="preconnect" href="https://api.icraftstories.com" crossorigin> <link rel="preconnect" href="https://clerk.accounts.dev" crossorigin> <link rel="preconnect" href="https://crisp-drake-11.clerk.accounts.dev" crossorigin> <link rel="preconnect" href="https://clerk.icraftstories.com" crossorigin> <link rel="preconnect" href="https://accounts.icraftstories.com" crossorigin> <link rel="preconnect" href="https://img.clerk.com" crossorigin> <link rel="dns-prefetch" href="https://img.clerk.com"> <script> // RADICAL SERVICE WORKER REMOVAL FOR AUTHENTICATION
    // This completely disables service workers when on authentication pages OR when rendering Clerk authentication widget
    (function() {
      try {
        // Check if page contains any Clerk resources or is an auth page
        var path = window.location.pathname;
        var isAuthPage = path.includes('/sign-in') || path.includes('/sign-up') || path.includes('/sign-out') || path.includes('/auth') || path.includes('/accept-team-invitation');
        var isClerkOnPage = document.referrer.includes('clerk') || 
                           window.location.search.includes('clerk') ||
                           document.cookie.includes('__clerk');
        
        // This logic is now handled below - no need for persistent flags
        
        // Check for the disable flag in either storage
        var disableSW = localStorage.getItem('auth_disable_sw') === 'true' || 
                        sessionStorage.getItem('auth_disable_sw') === 'true';
        
        // Only disable service workers on actual auth pages (not on all pages after visiting auth)
        if (isAuthPage) {
          console.log('Authentication page detected, temporarily disabling service workers');
          
          // Set only session storage flag (not persistent localStorage)
          sessionStorage.setItem('auth_disable_sw', 'true');
          
          // Block service worker registration only on auth pages
          if (navigator.serviceWorker) {
            // Monkey patch the register method to prevent registration
            var originalRegister = navigator.serviceWorker.register;
            navigator.serviceWorker.register = function() {
              console.log('Service worker registration blocked for authentication flow');
              return Promise.resolve({
                scope: '/',
                unregister: function() { return Promise.resolve(true); },
                update: function() { return Promise.resolve(); },
                addEventListener: function() {},
                removeEventListener: function() {}
              });
            };
          }
          
          // Unregister all service workers
          if ('serviceWorker' in navigator) {
            navigator.serviceWorker.getRegistrations().then(function(registrations) {
              registrations.forEach(function(registration) {
                registration.unregister();
                console.log('Service worker unregistered from HTML');
              });
            });
            
            // Clear all caches - especially important for Clerk resources
            if ('caches' in window) {
              caches.keys().then(function(cacheNames) {
                cacheNames.forEach(function(cacheName) {
                  caches.delete(cacheName);
                  console.log('Cache deleted:', cacheName);
                });
              });
            }
          }
        } else if (!isAuthPage) {
          // Clear flags on non-auth pages to allow service workers for all users
          console.log('Non-auth page detected, enabling service workers for all users');
          localStorage.removeItem('auth_disable_sw');
          sessionStorage.removeItem('auth_disable_sw');
        }
      } catch (e) {
        console.error('Error in service worker management:', e);
      }
    })(); </script> <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link rel="icon" type="image/png" sizes="192x192" href="/pwa-192x192.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="mask-icon" href="/maskable-icon.svg" color="#000000"> <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"> <meta name="theme-color" content="#ffffff"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <meta name="apple-mobile-web-app-title" content="iCraftStories"> <link rel="manifest" href="/manifest.webmanifest"> <title>iCraftStories: Social Story Creator and Sharing Community</title> <meta name="description" content="iCraftStories is a social story creator and sharing community. Create and share your stories with the world."> <meta name="keywords" content="iCraftStories, social story, creator, sharing, community, create, share, social stories"> <meta property="og:type" content="website"> <meta property="og:url" content="https://icraftstories.com/"> <meta property="og:title" content="iCraftStories: Social Story Creator and Sharing Community"> <meta property="og:description" content="Create and share your stories with the world. Join our creative community today!"> <meta property="og:image" content="https://icraftstories.com/library.png"> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:url" content="https://icraftstories.com/"> <meta property="twitter:title" content="iCraftStories: Social Story Creator and Sharing Community"> <meta property="twitter:description" content="Create and share your stories with the world. Join our creative community today!"> <meta property="twitter:image" content="https://icraftstories.com/library.png"> <link rel="canonical" href="https://icraftstories.com/"> <script type="application/ld+json"> {
      "@context": "https://schema.org",
      "@type": "WebApplication",
      "name": "iCraftStories",
      "applicationCategory": "CreativeApplication",
      "operatingSystem": "Web",
      "offers": {
        "@type": "Offer",
        "price": "0",
        "priceCurrency": "USD"
      },
      "description": "iCraftStories is a social story creator and sharing community. Create and share your stories with the world.",
      "screenshot": "https://icraftstories.com/library.png",
      "featureList": "Create stories, Share content, Community interaction, AI assistance",
      "softwareVersion": "8.0",
      "author": {
        "@type": "Organization",
        "name": "iCraftech LLC",
        "url": "https://icraftstories.com"
      }
    } </script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preload" href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" as="style"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet"> <script type="module" crossorigin src="/assets/index-MRh5ukMS.js"></script> <link rel="modulepreload" crossorigin href="/assets/vendor-BsyxCxuy.js"> <link rel="modulepreload" crossorigin href="/assets/ui-B57su4ch.js"> <link rel="modulepreload" crossorigin href="/assets/editor-B6rudYbV.js"> <link rel="modulepreload" crossorigin href="/assets/utils-BbITUOV2.js"> <link rel="modulepreload" crossorigin href="/assets/auth-p2wE2-O4.js"> <link rel="modulepreload" crossorigin href="/assets/i18n-xLvPWlvC.js"> <link rel="stylesheet" crossorigin href="/assets/index-DZmaSd_7.css"> <link rel="manifest" href="/manifest.webmanifest"></head> <body> <div id="root"></div> <!-- Cloudflare Pages Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "74400260e3b34463b1f8e41b22c655cf"}'></script><!-- Cloudflare Pages Analytics --></body> </html>