ERR_BLOCKED_BY_CLIENT

6,028 views
Skip to first unread message

Wei Nee Teh

unread,
Mar 22, 2021, 10:08:33 AM3/22/21
to securi...@chromium.org
Good afternoon,

I am working on a project which enables users to send and download pdf files. There is a problem with downloading pdf files as I get the ERR_BLOCKED_BY_CLIENT error message. Viewing of said pdf working in Firefox, but not on Chrome. May I know if this is an expected behaviour? Thank you in advance.


PhistucK

unread,
Mar 22, 2021, 12:34:54 PM3/22/21
to Wei Nee Teh, security-dev
What about in incognito mode? If it works, then it might be blocked by an extension.
If it is still not working, it might be a conflict with the content security policy of the page (I cannot remember whether that was solved already).

PhistucK


On Mon, Mar 22, 2021 at 2:08 PM Wei Nee Teh <wei...@djavafactory.com> wrote:
Good afternoon,

I am working on a project which enables users to send and download pdf files. There is a problem with downloading pdf files as I get the ERR_BLOCKED_BY_CLIENT error message. Viewing of said pdf working in Firefox, but not on Chrome. May I know if this is an expected behaviour? Thank you in advance.


--
To unsubscribe from this group and stop receiving emails from it, send an email to security-dev...@chromium.org.

Joe DeBlasio

unread,
Mar 22, 2021, 12:37:33 PM3/22/21
to PhistucK, Wei Nee Teh, security-dev
ERR_BLOCKED_BY_CLIENT is pretty widely used, so it's hard to tell whether what's happening is working as intended or not without additional details.

PhistucK's suggestion about extensions is a good one. A few other plausible explanations might include:
  • If you're serving your PDFs with the 'sandbox' attribute to the Content-Security-Policy header, you may be hitting crbug.com/1187122 . This is fixed in Chrome 91 or higher. A workaround is to drop the sandbox CSP attribute for PDFs.
  • If you're providing a link to a PDF on your page, and that page with the link is on an HTTPS page and the PDF is hosted on an HTTP page, you may be hitting our mixed download blocking.
If none of those fit your situation, we'd need more context to help you out.

Wei Nee Teh

unread,
May 27, 2021, 11:47:55 AM5/27/21
to Joe DeBlasio, PhistucK, security-dev
I have just gotten the Chrome 91 update and it is working fine now. Thank you very much for the fix!

Hagen Rahn

unread,
May 27, 2021, 11:48:00 AM5/27/21
to Security-dev, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
I can confirm that an upgrade to Chrome 91+ solves the issue. Thanks for the fix,

Giedrius Tuminauskas

unread,
Dec 20, 2022, 5:18:38 AM12/20/22
to Security-dev, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
The issue is still there on Chrome 108.* when using simple HREF link with target _blank and CSP set - displays: ERR_BLOCKED_BY_CLIENT
Though, if you try to open PDF document directly on Chrome in the new tab - it works

Michał Szarek

unread,
Jan 23, 2023, 2:50:43 PM1/23/23
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

Shubham Vishi

unread,
Mar 30, 2023, 12:05:37 PM3/30/23
to Security-dev, Michał Szarek, Giedrius Tuminauskas, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
Thanks Michal!

This solution is working for me but any idea what's the difference here? 

Why is it not working with normal click but working with Ctrl Click?

Shubham Vishi

unread,
Mar 30, 2023, 12:05:37 PM3/30/23
to Security-dev, Giedrius Tuminauskas, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
Hi Giedrius,

I am facing the same issue, was there any solution found for this?

Thanks,
Shubham

swapnil masutage

unread,
Jan 18, 2024, 9:12:39 AMJan 18
to Security-dev, Shubham Vishi, Giedrius Tuminauskas, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
I am still having the same issue on Chrome Browser version 120. The workaround mentioned by Michał Szarek is working for me. 
Why is it not working with normal click but working with Ctrl Click?
Any idea about this issue? I am a non-dev background.

Thank you.

Glassisimooptic

unread,
7:21 AM (7 hours ago) 7:21 AM
to Security-dev, swapnil masutage, Shubham Vishi, Giedrius Tuminauskas, Hagen Rahn, jdeb...@chromium.org, Wei Nee Teh, security-dev, PhistucK
Reply all
Reply to author
Forward
0 new messages