Jelmerro / Vieb

Vim Inspired Electron Browser - Vim bindings for the web by design
https://vieb.dev
GNU General Public License v3.0
1.29k stars 61 forks source link

Issue trying to load Mozilla Hubs #524

Closed r3k2 closed 8 months ago

r3k2 commented 8 months ago

Hello,

Information:

Vieb: Vim Inspired Electron Browser
This is version 10.4.0 of Vieb.
Vieb is based on Electron and inspired by Vim.
It can be used to browse the web entirely with the keyboard.
This release uses Electron 27.0.0 and Chromium 118.0.5993.54
Vieb is created by Jelmer van Arnhem and contributors.
Website: https://vieb.dev OR https://github.com/Jelmerro/Vieb
" Options
set adblocker=update
set devtoolsposition=split
set downloadmethod=confirm
set followchars=numbers
set guifontsize=16
set mapsuggestposition=bottomleft
set permissioncamera=ask
set permissiondisplaycapture=ask
set permissionmediadevices=allow
set permissionmicrophone=ask
set permissionpersistentstorage=allow
set permissionopenexternal=ask
set permissionunknown=ask
set favoritepages=https://kolektiva.media,https://hackthebox.com,https://video.hardlimit.com,https://lemmy.ml,https://hispagatos.space,https://forum.hackthebox.com
set redirecttohttp
set restoretabs=pinned
set tabclosefocus=right
set tabreopenposition=right
set useragent=%firefox
set windowtitle="%title - %app"
set darkreader=true

" Twitter
set redirects+=^https?://(www\.)?twitter.com(/.*)?~https://nitter.net$2
" Youtube
set redirects+=^https?://(www\.)?youtube.com(/.*)?~https://yewtu.be$2
" Teddit
set redirects+=^https?://(www\.)?reddit.com(/.*)?~https://teddit.net$2

Problem

-we have a room we created on mozilla hubs, this was working correctly on qutebrowser,nyxt, firefox etc.. but I get tons of errors when loading this on Vieb, I am not a web developer and I think is related to loading js script from another domain that is owned by Mozilla for mozilla hubs reticulum.io, but there are also some WebGL warnings. swappy-20231023-192041

Question

swappy-20231023-192606

Jelmerro commented 8 months ago

The CSP errors is a combination of an Electron limitation and how browsers are supposed to work, as we need to disable contextIsolation to be able to override specific APIs (see app/preload/privacy.js) but at the same time these preloads can be blocked by pages. The contextBridge API exists to "solve" this problem, but it cannot be used to override any APIs of the browser, hence it is useless for this purpose, thus we need to disable contextIsolation for the preload. In doing this, the CSP of the page affects the preload scripts, and can be blocked by it if the CSP is strict enough. These errors are not related to the page not working with regards to Vieb features being blocked, but they could be related with regards to that hispagatos script (and potentially others) being blocked. Though these scripts being blocked is in line with what the CSP is asking the browser to do, so this should be regarded a bug in Mozilla Hubs for setting it too strict, or in Firefox/qutebrowser etc. for not respecting it (security issue). It is implemented correctly in the latest Chrome/Chromium, where these errors can also be observed/reproduced.

As for the WebGL not working, this is a separate issue altogether, I have no experience with WebGL, but the demo seems to be working the same in Vieb compared to Chromium, although I don't have a VR device to test with. You might need to allow the right permissions to make that part work, you can see permission notifications on the :notification page or by using :help notificationforpermissions.