parkouss / webmacs

webmacs - keyboard driven (emacs key bindings) browser, https://webmacs.readthedocs.io/en/latest/
GNU General Public License v3.0
156 stars 21 forks source link

Feature request: Noscript-like javascript whitelisting #102

Open TLATER opened 5 years ago

TLATER commented 5 years ago

I find myself using firefox for some sites still because of the unholy amounts of entirely useless (and sometimes actively malicious) javascript they load - could something like noscript be implemented?

I figure it might be possible through the current adblocker, but I've not read far enough yet. It certainly would need additional commands to override specific rules per-page, since setting up proper whitelists involves a fair bit of trial-and-error from the user's side.

TLATER commented 5 years ago

I now have a proof of concept for this here.

A couple of notes:

I suspect @parkouss won't be particularly happy with my current approach, comments and ideas are welcome :)

parkouss commented 5 years ago

I quickly looked at your branch, it seems relatively clean and ok to me! If you want to bring such a feature (whitelist domain list option for javascript enabling) to webmacs master, I'm not against it - since it adds some value easily and won't go in the way of users that do not want something like that.

Other approaches for the no-script feature I can think of:

Note the options can coexists. I am thinking that being able to use local adblock rules would be nice anyway.

TLATER commented 5 years ago

@parkouss Personally, I struggled using adblock filter rules to do proper javascript filtering - I'd always end up executing some scripts I didn't want to, and it's inherently impossible to disable inline javascript with them. I'd also like to allow filtering based on GNU javascript labels, which afaik is currently impossible with adblock rules.

For my purposes I think a polished version of my current approach + the qt api (perhaps disable js in html loaded from a non-whitelisted domain?) would make the most sense - but I'm obviously still a little away from that ;)

I do agree that custom adblock rules would be very nice, should that perhaps be a separate issue?

parkouss commented 5 years ago

@TLATER thanks for sharing your experience, it makes sense. I'll create another issue for the custom, local adblock rules support.