Fulguris icon indicating copy to clipboard operation
Fulguris copied to clipboard

Content control causes render process crash

Open Cwpute opened this issue 1 year ago • 6 comments

Description

Trying to browse https://www.atelierloffet.com/ Fulguris suddenly froze and i couldn't interact with the page anymore. I could go to the options, try to browse other tabs, but they von't load and Fulguris would eventualy crash. I reloaded the same tab with javascript off (from domain settings) and it worked fine. Now, thisi isn't just a website problem, because i tried to aces this website through Thor browser with javascript on, and it worked fine too. So it is something in the way javascript is processed by Fulguris.

Environment

  • Device: Nokia TA-1157
  • OS: Android 11
  • Version: 1.9.13

To reproduce

Steps to reproduce the behaviour:

  1. Go to https://www.atelierloffet.com/
  2. Wait until the cookie banner appears.
  3. The tab is now frozen.

Expected behaviour

A badly written website can sonetimet nwt load, but if other browsers are able to load it, Fulguris should too. And it should not crash ! If it is indeed a problem of Javascript that can be pinned down but not solved now, at least prompt users to disable javascript for this website.

Cwpute avatar Oct 05 '23 09:10 Cwpute

I should add that even after closing the frozen tab, Fulguris keeps lagging until it crashes.

Cwpute avatar Oct 05 '23 09:10 Cwpute

@Cwpute That's a really good bug report I love to get those 😀 Could you confirm for me that disabling content control fixes your issue?

@Helium314 If you fancy taking a look at why ad blocker causes this page to crash, be my guest 😁 Disabling JavaScript also prevents the crash even when content control is on.

I'm currently working on a patch that would prevent such issues to crash the app.

Slion avatar Oct 06 '23 15:10 Slion

I tried with content control off and javascript still on, and yes, it does fix the issue with that website.

Cwpute avatar Oct 06 '23 18:10 Cwpute

When something is not working as it should disabling content control is the first thing to try. It's pretty intrusive and a lot could go wrong.

Slion avatar Oct 06 '23 18:10 Slion

@Helium314 If you fancy taking a look at why ad blocker causes this page to crash, be my guest 😁 Disabling JavaScript also prevents the crash even when content control is on.

The log message from the webview crash (after a few minutes) is some javascript OOM error. I guess the script is loading some other script, which is blocked and thus replaced by a no-op dummy script.

Changing the block response from dummy resource to

        return WebResourceResponse(
             mimeType,
             if (mimeType.startsWith("application") || mimeType.startsWith("text"))
                 "utf-8"
             else null,
+            503,
+            "nope",
+            emptyMap(),
             application.assets.open("blocker_resources/$filename")
        )

stops the freeze / crash. But I don't think using some error response for everything is a good solution. The replacement resources exist for a reason (not just in this blocker, also in uBlock Origin). Though maybe default responses could be tuned, so e.g. images get replaced (to avoid the ugly image-not-found icon), javascript gets blocked unless a replacement script is specified.

I don't remember how these block-or-replace things work in general, and which response code would be the "correct" one for a block...

Helium314 avatar Oct 26 '23 20:10 Helium314

That URL also crashes the render process when CC is enabled: https://www.vuplus.de/ultimo-4k

Slion avatar Jan 05 '24 19:01 Slion