;
        }
        return response.text();
      })
      .then(result => {
        statusElement.className = 'status success';
        statusElement.textContent = 'Message sent successfully!';
        console.log('Success:', result);
      })
      .catch(error => {
        console.error('Error with fetch:', error);
        
        // Fallback to GET method if POST fails
        const encodedValue = encodeURIComponent(messageType === 'extContent' ? data.value : message);
        const getUr