Make the plugin work with tabs

following the approach of themagicianprospero@github