question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORB blocks Google Drive API calls in NW.js only

See original GitHub issue

NWJS Version : 0.31.0+ (CORB was introduced in Chrome 67) Operating System : Windows 10 x64

In our software Construct 3, we use Google Drive’s API to save user’s projects to the cloud. However since CORB (Cross-Origin Read Blocking) was introduced in Chrome 67, Google Drive API are blocked by CORB, but only in NW.js. Chrome itself continues to work normally, and CORB only blocks the requests in NW.js.

The API calls fail and the following is logged to the console in NW.js indicating CORB blocked access (note this appears to only be logged if dev tools is open at the time the request is made): Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.googleapis.com/drive/v3/files?pageSize=1000&fields=... with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

Previously we used the following Chromium command-line flags to disable CORB as advised here: --disable-features=CrossSiteDocumentBlockingAlways,CrossSiteDocumentBlockingIfIsolating

Unfortunately these flags were recently deleted as you can see in this commit: https://chromium.googlesource.com/chromium/src.git/+/fb46cf461915c156e955748431ce7f5127b54f4c

This means the CORB problem has started happening again in our NW.js app. We can successfully work around it again by using --disable-web-security, but this seems dangerous. We only want to disable CORB, not the entire same-origin security policy.

I don’t know why CORB only blocks the API calls only in NW.js. I tried making sure the user agent is identical to Chrome 71’s, but that didn’t help. I also tested a build of Chromium instead of Chrome; it worked, the same as Chrome, so it’s specifically NW.js and not Chromium. Perhaps there is some change in NW.js that affects CORB? Alternatively if this is too difficult to work out, perhaps NW.js could provide its own flag to disable CORB? According to the previously linked commit, there is an is_corb_enabled flag that is set to false when --disable-web-security is passed; presumably an NW.js flag could do the same.

Google Drive is a major feature of our app - if we can’t find a solution we will be forced to use --disable-web-security which I’d prefer to avoid if at all possible.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TheRealDannyyycommented, Dec 7, 2018

@rogerwang Ashley’s probably busy but I’m a Construct 3 user, so here are the steps to reproduce:

  1. Download and unzip Construct 3 Desktop
  2. Run Construct3.exe
  3. Click on the cloud button
  4. Click on the service selector and select “Google Drive” (Google account login required)
  5. Notice error: “Failed to refresh file list”
0reactions
AshleyScirracommented, Dec 11, 2018

@rogerwang - confirmed 0.35.1 now works. Thanks for the quick fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop CORB from blocking requests to data resources ...
Background pages are not affected by CORS or CORB, so the browser no longer blocks the responses from the API.
Read more >
Cross-Origin Read Blocking (CORB)
The only case where a web page can load JSON with observable consequences, is via fetch() or XMLHttpRequest ; and in those cases,...
Read more >
Cross-Origin Read Blocking for Web Developers
Cross-Origin Read Blocking (CORB) is a new web platform security feature that helps mitigate the threat of side-channel attacks (including Spectre).
Read more >
Chrome app and extension permissions - Google Support
Admin console permission API What it does Experimental APIs experimental Allows app or extension to use experime... Fullscreen apps app.window.fullscreen Allows app to open in...
Read more >
Google Cloud latest news and announcements
We remain the top API Management vendor in our Ability to Execute, ... Docs; Google Cloud Deploy new blog post describing many new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found