fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.33k stars 99 forks source link

A friendly tip: switch to enable/disable-javascript-markup instead of enable/disable-javascript #734

Open z0noxz opened 1 year ago

z0noxz commented 1 year ago

https://github.com/fanglingsu/vimb/blob/8b85f9856797a6f8a0ba9817489bb4e185849b29/src/hints.c#L149

I see that you are using the "enable/disable javascript" setting, which can cause issues when using features that rely on JavaScript. In WebKit, there is an intermediate alternative that allows JavaScript to be enabled for the browser, while removing it from the markup. This effectively prevents websites from accessing JavaScript, while still allowing users to use its functionality for user scripts.

I use this feature for that exact reason in adji. This is how I have implemented it: https://noxz.tech/git/adji.git/commit/530a167cb57cf089f2b235dec08bbd817c6bf7df.html

Of course, you will have to change this throughout the entire source.

z0noxz commented 1 year ago

To clearify, I'm talking about this setting:

https://webkitgtk.org/reference/webkit2gtk/stable/property.Settings.enable-javascript-markup.html