Problem:
You want the Files and Library tabs to be visible when you browse to a page with multiple web parts.
Solution:
JavaScript! Add this to a Script Editor web part on the same page.
<script> setTimeout(function() { var elem = document.getElementById("MSOZoneCell_WebPartWPQ2"); if(elem != null) { var dummyevent = new Array(); dummyevent["target"] = elem; dummyevent["srcElement"] = elem; WpClick(dummyevent); _ribbonStartInit("Ribbon.Browse", true) } }, 2000); </script>
You may need to change “MSOZoneCell_WebPartWPQ2” to the web part ID of the web part you want to focus on. You can find this by opening dev tools.