Michał Szarek
unread,Jan 23, 2023, 2:50:43 PM1/23/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Security-dev, Giedrius Tuminauskas, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
Not sure if it is going to help You. So I was working on displaying pdf files in new tab, I have some documents stored on the server and I was fetching content of document then I was generating blob in order to generate url so I could open file in different tab. It was working fine until I was receiving
ERR_BLOCKED_BY_CLIENT error.
I was playing around with this issue for a while and I found strange behaviour when I had a link with static href to pdf file and targer _blank I was not able to display it when I clicked with left mouse button. However when I clicked using ctrl + left mouse button new tab was open and pdf file is displayed perfectly. You might try to dispatch mouse event with ctrlKey set to true.
const element = document.createElement("a")
element.setAttribute("href", url)
element.setAttribute("target", "_blank")
document.body.appendChild(element)
element.dispatchEvent(new MouseEvent("click", {
ctrlKey: true
}))
element.remove()
Hope it's going to help You, please let me know if that solves the issue