Voiceflow PartnersVPVoiceflow Partners
Powered by
dry-scarletD
Voiceflow Partners•3y ago
dry-scarlet

Using javascript to add title attributes to Voiceflow chat after loading for accessibility

Hello, I've tried adding some title attributes to the voiceflow dialog close, minimize, and launch buttons in order to provide compatibility for screen readers, but when I try this script I am unable to add the attribute. I am not really a developer so I might be going at this completely wrong <script type="text/javascript">

(function(d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function() {
window.voiceflow.chat.load({
verify: { projectID: '6546a5bd7e31c10008fce2bc' },
url: 'https://general-runtime.voiceflow.com',
versionID: 'production'
});
};

// Wait for the chat widget to fully load
setTimeout(function() {
// Example: Modify alt text of buttons. This requires you to know the structure of the chatbot's HTML.
// This is a hypothetical example, as actual implementation would depend on the generated DOM of the Voiceflow widget.
var closeButton = document.getElementsByClassName('c-dzcdPv vfrc-header--button c-dxAZjf');

closeButton.addAttribute('title', 'Close Chat Button');
// Or, if you're trying to edit text, not alt attribute (since buttons usually don't have alt attributes)
closeButton.textContent = 'close chat window button';
);
}, 3000); // Adjust delay as needed to ensure widget is fully loaded
};
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs"; v.type = "text/javascript"; s.parentNode.insertBefore(v, s);
})(document, 'script');
// };

</script>
Voiceflow Partners banner
Voiceflow PartnersJoin
Exclusive community for Voiceflow Solutions Providers & Content Creators.
13,076Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 4mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 4mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 4mo ago

Similar Threads

Full Screen Voiceflow Web-Chat integration
colourful-plumCcolourful-plum / ❓┃ask-a-question
2y ago
how to add a suggested question on voiceflow?
unique-blueUunique-blue / ❓┃ask-a-question
2y ago
Chat loading malfunction
hrubasekHhrubasek / ❓┃ask-a-question
9mo ago
Using Custom Javascript Code For Data Formatting
endless-jadeEendless-jade / ❓┃ask-a-question
2y ago