New version of Discourse dropped support for QtWebEngine 5.15 LTS

There is a major annoyance with the new version of Discourse that was deployed here today: It now refuses to bring up the JavaScript interface on QtWebEngine 5.15 LTS, which includes the latest versions of Falkon and Angelfish (the latter being used as the default browser on Manjaro Plasma Mobile). A workaround is to add an ad blocking rule for ||forum.manjaro.org/assets/browser-detect-*.js. That allowed me to post this message with Falkon.

Going through the checks in the browser-detect.js script, the only thing that it is missing is CSS.supports("aspect-ratio: 1"), which is a pretty weak justification for refusing to bring up the JavaScript interface altogether, especially considering that it looks just fine.

Seems to have killed qutebrowser (qt-5) version as well.

:rage:

I would suggest to the site admins to just patch the deployed copy of Discourse to remove the || !CSS.supports || !CSS.supports("aspect-ratio: 1") checks (or at least the || !CSS.supports("aspect-ratio: 1") part, though the check for CSS.supports itself was only added to support the latter, but at least CSS.supports itself exists on QtWebEngine 5.15 LTS) from the deployed browser-detect-*.js script.

1 Like

For Angelfish, since it does not directly allow specifying custom rules, you have to create a local file with the rule:

echo '||forum.manjaro.org/assets/browser-detect-*.js' >
adblocklist.txt

then add the ruleset file to Angelfish under Settings / Adblock / (+):
Name: Local Blocklist
Url: file:///home/yourusername/adblocklist.txt

2 Likes

Hello Kevin. I tried this, but it does not work. Also, trying to access the URL “file:///home/mark/adblocklist.txt” (which is where the file is located) results in a duckduckgo search for this phrase, rather than opening the text file for viewing within the browser (that being Angelfish)…

I can assure you that it works for me with Angelfish 23.01.0.

Same here, but that does not stop it from working as an adblocklist.





Hello Kevin. Please see screenshots to see if you can tell me where I’ve made an error in following your instructions.

You pasted the whole echo command into the file instead of just the adblock rule (the part between the single quotes). The echo command is intended to be written in the terminal where you wrote cat adblocklist.txt. If you are using another way to fill that file, you do not need the echo command.

Okay, thanks. I removed the adblocklist.txt file, then ran the command, creating a new and proper adblocklist.txt file, yet I still am prevented from being able to sign in to the forum here on my Pinephone Pro using the Angelfish browser. It still indicates that the browser is not supported.

Try refreshing the page maybe? If that does not help, you may have to clear the browser cache. Though it worked for me without clearing the cache, even though I already had the script cached when I added the ad block rule.

And can you maybe post another screenshot of you cating the file, so we can see if there are not more typos remaining? Any error and the rule will silently fail.

Here is a screenshot showing the most recent file:

Note, I did this before the most recent upgrade (testing). This upgrade has caused the system to become unusable. So, I’m going to wait for a future upgrade which hopefully will provide a fix, since I can’t fix it on my own.

The rule looks good, no idea why it is not working for you.

Though it looks like upstream Discourse has made it even more of a PITA in the next update that is thankfully not yet deployed here.

Okay, I did figure it out. I had to refresh the adblock rules to get it to see the newly added rule. So it is now working and I’m currently typing this with the Pinephone Pro. Thanks for your help.

Now the aforementioned update:

that makes things even more broken and requires the developer tools to work around is deployed here too, grrr!

And now they made applying even that workaround a PITA because they added a web app manifest, so by default the developer tools open the script in the Application tab, which does not allow editing, instead of the Sources tab, which does. Adding yet another ad blocking rule, this time for ||forum.manjaro.org/manifest.webmanifest, fixes that. You still have to hack around in the developer tools, mind you, but blocking the web app manifest is needed to even be able to.

It looks like Discourse upstream is really set to break Falkon and Konqueror in any and all ways possible just to be a PITA. The everchanging UI is also a PITA.

And Palemoon too

Discourse now packages its scripts in obfuscated “webpacks” so it is no longer possible to edit the code.

It is, however, possible to modify the DOM itself to make the code no longer throw an exception: Execute this in the JavaScript console:

document.querySelectorAll = function(selectors) {return Array.of();};

Now you will probably (and should!) ask: What does that snippet do? Well, it replaces the method document.querySelectorAll with a lambda function that takes one argument just like the original document.querySelectorAll, but it ignores the argument and always returns an empty list. (An empty Array, which, while technically not a NodeList, will pass for an empty NodeList for most code.) This allows the posting code to proceed without throwing an exception on the unsupported selector string.