Scripted refresh of web view stealing focus

I'm using a floating window with a single scripted web view that refreshes the content from a localhost address every x seconds. The script is just:

(async ()=> {
   await webview_menu_item_load_html_url_js(
      {
         "item_uuid": "F8264DB6-D6CB-4BAB-B057-95D7D43155E1", 
         "html_or_url": "http://localhost:80"
      }
   )
   returnToBTT('done');
})()

I've noticed every time the refresh is triggered, the web view steals focus from other apps. This also happens when disabling the script, setting a trigger to refresh the web view, and then calling the btt:// url to trigger it, which tells me it's the act of triggering the refresh doing it (I was trying to workaround by using my own refresh functionality with the url scheme).

Is there any way to avoid this? I just want to make an always visible display widget that is updated automatically by polling a localhost server. It also just generally seems inadvisable that a refresh to a web view should cause it to be focused.