QupZilla / qupzilla

Cross-platform Qt web browser
http://www.qupzilla.com
GNU General Public License v3.0
1.11k stars 349 forks source link

[Feature Request] Disable java script for selected websites? #2490

Closed ghost closed 6 years ago

ghost commented 6 years ago

I want to disable java scripts in selected websites. Latest qupzilla appimage has only allow or disallow whole web traffic (edit>preference>web config>Allow javascript). Need a way to prevent some websites from loading java scripts.

ghost commented 6 years ago

The way is calling „Adblock“!

nowrep commented 6 years ago

It's not possible to implement it reliably with QtWebEngine.

ghost commented 6 years ago

@cranes-bill How should I use adblock to block javascript in selected website? Can you elborate a little?

ghost commented 6 years ago

I didn't try, but Adblock has a script blocking option, so it should works with javascripts as well.

ghost commented 6 years ago

@cranes-bill I tried to write custom rules in adblock for blocking javascript ||website.com^ $script This does not seem to work in qupzilla.

@nowrep Because there is no posiblity of solving this problem I am closing my issue.

Martii commented 6 years ago

This does not seem to work in qupzilla.

Didn't block any scripts for OUJS when I added our domain. :\ Reconfirmed rule syntax with one from EasyList. New issue time?

clavinet commented 6 years ago

\ It's not possible to implement it reliably with QtWebEngine.

I'm using this workaround:

Enable JavaScript in QupZilla settings, but add some custom Adblock rules:

This will block JavaScript on all sites except "example.net", "example.com" and "example.xyz" *$script,domain=~example.net|example.com|example.xyz

This blocks 3rd party JS on all sites except "example.net" and "example.xyz: *$script,third-party,domain=~example.net|example.xyz

So when a site doesn't work without JavaScript, I first enable 1st party JS, and if it still doesn't work, 3rd party JS as well. So far, I don't have any issues.

It's a little cumbersome, but it works. Couldn't this be implemented in an easier way, like a list? @potholiday maybe try my method, it should do what you want by tackling the problem backwards (first block everything, and then add exceptions)

nowrep commented 6 years ago

@nekoswag That will only block externally loaded scripts, but not JavaScript in html source.

Actually, there seems to be a way to do this with QtWebEngine so it could be implemented.

clavinet commented 6 years ago

I didn't know that, thanks for telling. JavaScript is a big attack vector on the web nowadays, many people use Firefox just because it has uMatrix that lets you set JS rules comfortably. Having a similar feature in QupZilla would be great :)

nowrep commented 6 years ago

Well, then someone needs to implement it for QupZilla (well, Falkon). That someone may eventually be me, of course :D

ghost commented 6 years ago

@nekoswag Thank you for sharing your solution

JavaScript is a big attack vector on the web nowadays, many people use Firefox just because it has uMatrix

I was going to ask for the same thing. @nowrep Can I ask will Falkon support other linux machines than KDE especially the appimage? When is the possible release date? is this going to be the development page https://github.com/KDE/falkon