diff --git a/src/translation.js b/src/translation.js index c5f8a12..d12b184 100644 --- a/src/translation.js +++ b/src/translation.js @@ -379,10 +379,12 @@ export async function translateCurrentPage(targetLanguage) { doc.body.innerHTML = translatedContent; // Inline any external CSS that might be needed for the new window - const cssLinks = doc.querySelectorAll('link[rel="stylesheet"][href*="uncloseai"]'); + const cssLinks = doc.querySelectorAll('link[rel="stylesheet"][href*="uncloseai-modal"]'); + console.log('Found CSS links to inline:', cssLinks.length); for (const link of cssLinks) { try { + console.log('Inlining CSS:', link.href); const response = await fetch(link.href); const cssContent = await response.text(); @@ -392,6 +394,7 @@ export async function translateCurrentPage(targetLanguage) { // Replace the link with the inline style link.parentNode.replaceChild(styleElement, link); + console.log('Successfully inlined CSS:', link.href); } catch (error) { console.warn('Failed to inline CSS:', link.href, error); // Keep the original link if fetching fails