How to automate inside a tab of an extension?

See also How to Automate your Chrome Browser Extension App (Browser extension testing)