Run a function in exactly one open tab, switching to another if closed
Perform check on list of gateway to find the best reliable http gateway