I am working on a project that behaves very strange when the user open pages in a new tab or in a new window, causing the app to crash.
I need some javascript that
Replace all < a > tags attribute to _self, that will force the broswer to open the hyperlink in a new tab
Array.prototype.forEach.call(document.getElementsByTagName('a'), function(el, i){ if(el.target=="_blank"){ el.target="_self" } });