// Preserve task parameter before SPA strips it (function() { // console.log('🔍 Task parameter preservation script loaded'); // Check current URL for task parameter const currentUrl = window.location.href; const urlParams = new URLSearchParams(window.location.search); const taskId = urlParams.get('task'); // console.log('🔍 Current URL:', currentUrl); // console.log('🔍 Task parameter detected:', taskId); if (taskId) { // Store task parameter in sessionStorage sessionStorage.setItem('pendingTaskId', taskId); // console.log('🔍 Stored task ID in sessionStorage:', taskId); } })();