I'm working on a javascript macro to open a specific link on a site in a new tab, but I'm not able to get the link to open in a new tab.
Here's the code:
document.onload = window.frames[0].document.getElementsByClassName('TextCell SA Link FW100 AL')[0].click()
I've tried using the window.open()
function, but it doesn't seem to be working for me. Here's how I wrote it
document.onload=window.open(window.frames[0].document.getElementsByClassName('TextCell SA Link FW100 AL')[0].click(),'_blank')
HTML:
<td class="TextCell SA Link FW100 AL"
onclick="(function(e) { e.preventDefault(); e.stopPropagation(); return autotask.siteNavigation.__openPage(new Autotask.PopupPage('ProjectDetail','\/projects\/views\/100\/prjView_100.asp',false,'objectID','2359',false,false,new Autotask.PopupSettings(550,null,950,null,false))); })(event)">
P20190930.0003
</td>