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.

Crash on new tab using fetch

See original GitHub issue

Description

The new tab (brave://newtab) crashes when using fetch in the browser console.

Steps to Reproduce

  1. Open a new tab (brave://newtab)
  2. Open the browser console
  3. type in fetch('https://brave.com')

Actual result:

The browser window crashes.

Expected result:

The window should continue to function normally.

Reproduces how often:

Every time.

Brave version (brave://version info)

Brave 1.3.115 Chromium: 80.0.3987.87 (Official Build) (64-bit)
Revision 449cb163497b70dbf98d389f54e38e85d4c59b43-refs/branch-heads/3987@{#801}
OS Windows 10 OS Version 1809 (Build 17763.973)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes.
  • Can you reproduce this issue with the beta channel? Haven’t tried.
  • Can you reproduce this issue with the dev channel? Haven’t tried.
  • Can you reproduce this issue with the nightly channel? Haven’t tried.

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? No.
  • Does the issue resolve itself when disabling Brave Rewards? No.
  • Is the issue reproducible on the latest version of Chrome? No.

Miscellaneous Information:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bigfoxtailcommented, Aug 13, 2020

https://chromium.googlesource.com/chromium/src.git/+/master/docs/webui_explainer.md#security-considerations

WebUI pages cannot embed http/https resources or frames
WebUI pages cannot issue http/https fetches

This is chrome’s security policy. It seems to be possible to change the security policy for the WebUI bindings, but I don’t know where to change it. Or modify the web_ui_url_loader_factory.cc file, but that would make the browser insecure. If you have found a way to do this, I hope you can explain to me the following thanks😀

0reactions
bscliftoncommented, Aug 13, 2020

Good find @bigfoxtail 😄 I didn’t consider that was why it was happening

You are correct - WebUI does not have access to fetch external resources and that is 100% expected. The usual flow when external content is needed would be that JavaScript on the page will communicate with native handlers registered for the Web UI page. That native C++ code then has access to fetch whatever it needs

Given that this is a limitation of Web UI and we won’t want to change it (due to security considerations), I’m going to close this issue as wontfix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending thousands of fetch requests crashes the browser. Out ...
So when I tried V3.0 in my question above, chunking the array into 1000 records before sending, I could watch the progress in...
Read more >
463572 - Devtools: timeline recording crashes the tab - Monorail
2. Open Timeline dev tool. 3. With "Causes" and "Paint" checked, begin a recording. ... 6. End the recording. What is the expected...
Read more >
My browser keeps crashing when I have more than one tab ...
It could be a resource leak, a bug that slowly leads to a fault. Adding columns to the details tab of task manager...
Read more >
Fix "Aw, Snap!" page crashes and other page loading errors
On your Android phone or tablet, open the Chrome app Chrome . Tap More More and then New Incognito tab. In the Incognito...
Read more >
Handling common JavaScript problems - MDN Web Docs
When developers make use of new/nascent JavaScript features, modern Web APIs, etc.) in their code, and find that such features don't work in...
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