Player APIs (BrightScript & Ja...
BrightScript-JavaScript Object...
Enabling BrightScript-JavaScript Objects
4min
for security reasons, all brightscript javascript objects are disabled by default as a result, you will encounter dom errors like those shown below if you do not enable first enable them (to view a console log of brightscript/javascript events, go to the diagnostic web server (dws) docid\ qxt4yhey7iej m9dh73wm or use the javascript console) follow the below steps to enable brightscript javascript objects enabling with brightauthor make sure that you are using brightauthor version 4 1 or later earlier versions do not have the code that enables brightscript objects for javascript also, ensure that the enable external data box is checked within the html5 state that is displaying your page enabling with brightscript include the brightsign js objects enabled\ true entry with the associative array that is passed during creation of the docid\ xljq5 yhdma2ssmpzimtk instance example r=createobject("rorectangle",0,0,1920,1080) aa=createobject("roassociativearray") aa url="http //test server/index html" aa brightsign js objects enabled=true bb=createobject("roassociativearray") bb port=3000 aa inspector server=bb h=createobject("rohtmlwidget",r,aa) h show() the above method enables all brightscript javascript objects on an rohtmwidget instance to enable only a subset of brightscript javascript objects, or to restrict the objects to certain urls, use the allowjavascripturls() method on a rohtmlwidget instance this method accepts an associative array that maps brightscript javascript classes to the url(s) that are allowed to use them an all key indicates that all classes are authorized for the associated url(s) an asterisk " " value indicates that all urls are authorized for the associated brightscript javascript class a "local" value indicates that all local pages are authorized for the associated brightscript javascript class this will enable all brightscript classes for all urls html allowjavascripturls({ all " " }) this call will enable all brightscript javascript classes for local pages and the brightsign homepage html allowjavascripturls({ all \["local", "http //www brightsign biz"]})