merged back changes (e.g. acquiring tab id, fixing scope issues) from mitm-tool