Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Is there a way to send a message to the chat that contains a script through the API?

I am trying to make an API script that when ready will send a chat entry that contains a script, so it can run on the website itself. If this is possible (or if there is any other way to make a script run on the website through the API) then i can use it to gain access to the document element, which i need for the script, is there no way to do that? and if there is no way, will there be a way in the future?
1563275606
The Aaron
Roll20 Production Team
API Scripter
There is no way for the API to gain access to the DOM in the browser. Neither is there a way for Sheet Workers to gain access to the DOM. Running arbitrary code on users' browsers would be a serious security risk.  If you want things to happen in YOUR browser based on something the API does, you could run a javascript in YOUR browser that monitors the chat and performs some action for a given output. You'd use xJS or Greasemonkey or some other browser extension to do that.