// Wait for the Drift widget to be ready
drift.on('ready', function(api) {
// Find the input inside the widget and update its placeholder
var interval = setInterval(function() {
var inputField = document.querySelector('iframe[data-testid="chat-widget-frame"]');
if (inputField) {
const innerDoc = inputField.contentDocument || inputField.contentWindow.document;
const input = innerDoc.querySelector('input[placeholder="Write a reply..."]');
if (input) {
input.setAttribute('placeholder', 'Type your custom text here...');
clearInterval(interval); // Stop checking once updated
}
}
}, 500);
});