function works in all and unread views

but problem with new tab opening (All links open in 1new tab)