updated port impl for background pages