As far as I made it with the approach in which the content script gets more control.