The above can be copy-pasted into a terminal or save it as a bookmarklet by saving the following as the URL (sorry, GitHub's markdown won't let me directly link a bookmarklet)
javascript:(function openLinksInNewTab(){Set(Array.prototype.filter.call(document.querySelectorAll('[href]'),function(a){return a.tagName.toLowerCase()!=='link'&&a.href[0]!=='#';}).map(function(a){return a.href;})).forEach(function(a){window.open(a,'_blank');});}());