How to wire background extensions up properly in SuiteCRM 8.x

This example works as long as the browser is logged on to SuiteCRM in some tab

I never got around to handling the authentication (and storing the cookies?) but I think this is a good start for you.