Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
27 righe
1.1 KiB
27 righe
1.1 KiB
import { TaskFlow } from "./utils/TaskFlow.js"; |
|
document.addEventListener('DOMContentLoaded', () => { |
|
try { |
|
const container = document.createElement('div'); |
|
document.body.appendChild(container); |
|
const shadowRoot = container.attachShadow({ mode: 'open' }); |
|
const uiContainer = document.createElement('div'); |
|
const style = document.createElement('style'); |
|
shadowRoot.appendChild(style); |
|
const cssPath = `${window.location.origin}/js/ia-form-filler/styles/style.css`; |
|
// Fetch e inietta il CSS dal file esterno |
|
fetch(cssPath) |
|
.then(response => response.text()) |
|
.then(css => { |
|
style.textContent = css; |
|
uiContainer.style.cssText = 'position: absolute; top: 0; left: 0; z-index: 9999;'; |
|
shadowRoot.appendChild(uiContainer); |
|
TaskFlow.run(uiContainer); |
|
}) |
|
.catch(error => { |
|
console.error("Errore durante il caricamento del CSS:", error); |
|
}); |
|
} |
|
catch (error) { |
|
console.error("Errore durante il caricamento di TaskFlow:", error); |
|
} |
|
});
|
|
|