0

Pure HTML Site presentation with script plugin not allowing html content to display

I have a presentation that just runs a single HTML site. When run by itself with no script plugins on the presentation, it runs fine. However, when adding in the below script plugin, and issue arrises that the html display seems to no longer be visible or it is hidden. The logs from the html site are still logged and I can see that it is still running, however none of the content is visible any longer. Is there something in a script plugin that will block the html display or hide it that needs to be accounted for?

Script plugin:

Function watchDog_Initialize(msgPort As Object, userVariables As Object, bsp As Object) As Object
bsp.diagnostics.printdebug("Watchdog: Initializing (autorun plugin) 30 seconds")

plugin=CreateObject("roAssociativeArray")
plugin.msgPort = msgPort
plugin.bsp = bsp
plugin.userVariables = userVariables
plugin.objectName = "watchdog"

plugin.lastHeartbeatMs = watchDog_GetNowMsSafe()
plugin.heartbeatTimeoutMs = 180000
plugin.heartbeatCount = 0
plugin.lastLogMs = plugin.lastHeartbeatMs

' Assign required methods
plugin.ProcessEvent = watchDog_ProcessEvent
plugin.ReceiveHeartbeat = watchDog_ReceiveHeartbeat
plugin.CheckHeartbeat = watchDog_CheckHeartbeat
plugin.GetNowMs = watchDog_GetNowMsSafe

' Setup timer
plugin.timer = CreateObject("roTimer")
plugin.timer.SetPort(msgPort)
plugin.timer.SetElapsed(30000, 0)
plugin.timer.Start()

bsp.diagnostics.printdebug("Watchdog: Plugin initialized successfully")
return plugin
End Function

Function watchDog_ProcessEvent(event As Object) As Boolean
m.bsp.diagnostics.printdebug("Watchdog: In ProcessEvent")
' cast or retrieve plugin object from context:
plugin= m' m should refer to the plugin associative array
plugin.CheckHeartbeat()
return false
End Function

Function watchDog_ReceiveHeartbeat() As Void
plugin= m
plugin.lastHeartbeatMs = plugin.GetNowMs()
plugin.heartbeatCount = plugin.heartbeatCount + 1
if (plugin.lastHeartbeatMs- plugin.lastLogMs) >60000then
plugin.bsp.diagnostics.printdebug("Watchdog: Received heartbeat, count = " + StrI(plugin.heartbeatCount).Trim())
plugin.lastLogMs = plugin.lastHeartbeatMs
end if
End Function

Function watchDog_CheckHeartbeat() As Void
plugin= m
plugin.bsp.diagnostics.printdebug("Watchdog: Checking heartbeat...")
nowMs= plugin.GetNowMs()
if (nowMs- plugin.lastHeartbeatMs) > plugin.heartbeatTimeoutMs then
plugin.bsp.diagnostics.printdebug("Watchdog: Heartbeat timeout — rebooting")
CreateObject("roDeviceInfo").Reboot()
end if
plugin.timer.Start()
End Function

Function watchDog_GetNowMsSafe() As Integer
' safe call
returnUpTime(0) *1000
End Function

1 comment

  • 0
    Avatar
    Thomas201Tang

    The issue likely stems from the script plugin's roTimer and shared msgPort, which may be intercepting or interfering with events needed by the HTML display. To fix this, ensure the plugin only processes expected events (like roTimerEvent) and doesn’t affect rendering or visibility settings. Avoid triggering UI changes or consuming unrelated events, and test by disabling the timer or plugin temporarily to isolate the cause.  my ford benefits

Please sign in to leave a comment.