Can Chromium send OPTIONS request when sending request from extension background script?

111 views
Skip to first unread message

Juraj M.

unread,
Sep 3, 2024, 8:19:25 AMSep 3
to Chromium Extensions
For quite some time I've been seeing OPTIONS requests on my server.
They all fail with 404 since I don't have handler for it.
But I can't find a reason why would a client send them.
Based on the request path, they are coming from my extension, and ONLY from Chromium browsers, never from Firefox.
But I can't reproduce it locally.
It seems only some clients are producing these requests and they are sending them A LOT, I had to add a leaky bucket to my NginX config to reduce them.

Can you think of a use case when would extension send an OPTIONS request?
My extension has "<all_urls>" permission.

server_log.png

Juraj Mäsiar

unread,
Sep 3, 2024, 11:12:12 AMSep 3
to Brent Montrose, Chromium Extensions

Thanks a lot Brent!

This is indeed the issue, I can finally reproduce it. 

I'm so happy! And this means I can even detect it and fix it! What a great news :)

Have a great day :)

Best regards,

Juraj Mäsiar
On 3. 9. 2024 16:59, Brent Montrose wrote:

We've seen a similar issue when a user removes the "<all_urls>" permission from the extension by right-clicking on the Chrome toolbar icon and selecting something other than the "on all sites" option.  If a fetch is then done from the service worker or background page, Chrome sends a preflight request to the server to verify access.

While researching our issue, I also came across this Chrome bug.

https://issues.chromium.org/issues/351623257

Brent Montrose

unread,
Sep 4, 2024, 1:36:34 AMSep 4
to Chromium Extensions, Juraj M.

We've seen a similar issue when a user removes the "<all_urls>" permission from the extension by right-clicking on the Chrome toolbar icon and selecting something other than the "on all sites" option.  If a fetch is then done from the service worker or background page, Chrome sends a preflight request to the server to verify access.

While researching our issue, I also came across this Chrome bug.

https://issues.chromium.org/issues/351623257





On Tuesday, September 3, 2024 at 6:19:25 AM UTC-6 Juraj M. wrote:
Reply all
Reply to author
Forward
0 new messages