if (!widget) return;
const styles = msg.data?.styles; const token = msg.data?.token; const urlToken = new URL(widget.src)?.searchParams?.get?.('token'); if (styles && token === urlToken) { Object.keys(styles).forEach(key => widget.style.setProperty(key, styles[key])) } });