After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776682 - Use EphyDownload to download adblock filters
Use EphyDownload to download adblock filters
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Web Applications
3.22.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 776514
 
 
Reported: 2017-01-01 14:21 UTC by what103
Modified: 2018-03-25 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
(Broken) use EphyDownload to download adblock filters (20.78 KB, patch)
2017-01-23 17:17 UTC, Michael Catanzaro
none Details | Review
(Broken) use EphyDownload to download adblock filters (8.74 KB, patch)
2017-01-23 17:18 UTC, Michael Catanzaro
needs-work Details | Review
Use EphyDownload to download adblock filters (9.22 KB, patch)
2017-11-15 02:11 UTC, Michael Catanzaro
committed Details | Review

Description what103 2017-01-01 14:21:43 UTC
Hello.
I have epiphany without xwayland, all very good youtube with alsa, fast, proxy with ~/.bashrc all work and gj very big thanks, but i dont can use adblock.

i am use mini.iso ubuntu. install weston, gedit, epiphany,gnome-terminal without dependence. when i am want include sound iam install gstreamer-good,base,alsa and i am get sound with mp3 and video html5. my test html5 now 
YOUR BROWSER SCORES 386 OUT OF 555 POINTS but no work adblock, i think need webkit package, but i dont know how package me need for mini.iso.


i remove .config/epiphany/adblock folder
and start epiphany, and see new .config/epiphany/adblock
but if i am add .config/epiphany/adblock/filters.list a no get 32 hex chars file and adblock no work.

say pls how package need install to epiphany and adblock begin work?

thanks.
Comment 1 Michael Catanzaro 2017-01-01 15:59:14 UTC
It should work automatically. Could you open the Preferences window and confirm that Allow advertisements is *not* checked?

Also, please open the About dialog and tell me the exact version number of Epiphany that you see there, since this code has changed a lot recently.
Comment 2 what103 2017-01-01 17:02:22 UTC
$ epiphany-browser --version
Веб-браузер 3.22.4

no dialog no supported action

yes setting no actuality enable adds no check
Comment 3 Michael Catanzaro 2017-01-01 20:14:23 UTC
OK, so the setting is disabled, but there is no file with a 32-character name created under ~/.config/epiphany/adblock?

Note: it might miss country-specific ads as it is not currently smart enough to subscribe to country-specific filters, so test on some US site like cnn.com.
Comment 4 Michael Catanzaro 2017-01-01 20:17:52 UTC
Are you able to ping EasyList?

$ ping -c1 easylist-downloads.adblockplus.org
Comment 5 what103 2017-01-01 21:13:14 UTC
thanks
ping -c1 easylist-downloads.adblockplus.org
PING easylist-downloads.adblockplus.org (176.9.127.15) 56(84) bytes of data.
^C
--- easylist-downloads.adblockplus.org ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

i have ufw farewall default deny and drop echo


why no use 80 or 443 ports? 

and sry but i no know how enable ping

my /etc/ufw/before.rule

# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o enp4s0 -j MASQUERADE

# don't delete the 'COMMIT' line or these nat table rules won't be processed
COMMIT

#
# rules.before
#
# Rules that should be run before the ufw command line added rules. Custom
# rules should be added to one of these chains:
#   ufw-before-input
#   ufw-before-output
#   ufw-before-forward
#

# Don't delete these required lines, otherwise there will be errors
*filter
:ufw-before-input - [0:0]
:ufw-before-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-not-local - [0:0]
# End required lines

# allow all on loopback
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-output -o lo -j ACCEPT

#for users
-A ufw-before-output -m owner --uid-owner m -p all -j DROP
#-A ufw-before-input -m owner --uid-owner m -p all -j DROP
#-A ufw-before-forward -m owner --uid-owner m -p all -j DROP

# quickly process packets for which we already have a connection
-A ufw-before-input -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-output -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -m conntrack --ctstate RELATED,ESTABLISHED -j DROP

# drop INVALID packets (logs these in loglevel medium and higher)
-A ufw-before-input -m conntrack --ctstate INVALID -j ufw-logging-deny
-A ufw-before-input -m conntrack --ctstate INVALID -j DROP

# ok icmp codes for INPUT
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j DROP
-A ufw-before-input -p icmp --icmp-type source-quench -j DROP
-A ufw-before-input -p icmp --icmp-type time-exceeded -j DROP
-A ufw-before-input -p icmp --icmp-type parameter-problem -j DROP
-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT

# ok icmp code for FORWARD
-A ufw-before-forward -p icmp --icmp-type destination-unreachable -j DROP
-A ufw-before-forward -p icmp --icmp-type source-quench -j DROP
-A ufw-before-forward -p icmp --icmp-type time-exceeded -j DROP
-A ufw-before-forward -p icmp --icmp-type parameter-problem -j DROP
-A ufw-before-forward -p icmp --icmp-type echo-request -j ACCEPT

# allow dhcp client to work
-A ufw-before-input -p udp --sport 67 --dport 68 -j DROP

#
# ufw-not-local
#
-A ufw-before-input -j ufw-not-local

# if LOCAL, RETURN
-A ufw-not-local -m addrtype --dst-type LOCAL -j DROP

# if MULTICAST, RETURN
-A ufw-not-local -m addrtype --dst-type MULTICAST -j DROP

# if BROADCAST, RETURN
-A ufw-not-local -m addrtype --dst-type BROADCAST -j DROP

# all other non-local packets are dropped
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP

# allow MULTICAST mDNS for service discovery (be sure the MULTICAST line above
# is uncommented)
-A ufw-before-input -p udp -d 224.0.0.251 --dport 5353 -j DROP

# allow MULTICAST UPnP for service discovery (be sure the MULTICAST line above
# is uncommented)
-A ufw-before-input -p udp -d 239.255.255.250 --dport 1900 -j DROP

# don't delete the 'COMMIT' line or these rules won't be processed
Comment 6 what103 2017-01-01 21:20:24 UTC
(In reply to Michael Catanzaro from comment #3)
> OK, so the setting is disabled, but there is no file with a 32-character
> name created under ~/.config/epiphany/adblock?
> 
> Note: it might miss country-specific ads as it is not currently smart enough
> to subscribe to country-specific filters, so test on some US site like
> cnn.com.

yes i use proxy tor but adblock fiters site i have free connect

my .config/epiphany/adblock/filters.list

https://easylist-downloads.adblockplus.org/liste_fr+easylist.txt
Comment 7 what103 2017-01-12 08:17:29 UTC
without ping no can work?
when i use chrome or ff i get adblock rules and update without ping.
Comment 8 Michael Catanzaro 2017-01-12 18:56:07 UTC
I don't think ping should matter, I was just suggesting that as a way to test if you can connect to EasyList. I didn't anticipate that you would have firewall rules to block ICMP traffic.

I don't know what's going wrong here, but it sounds like a problem with your network. Epiphany just downloads the filters from EasyList, that's all there is to it.
Comment 9 what103 2017-01-13 04:18:06 UTC
(In reply to Michael Catanzaro from comment #8)
> I don't think ping should matter, I was just suggesting that as a way to
> test if you can connect to EasyList. I didn't anticipate that you would have
> firewall rules to block ICMP traffic.
> 
> I don't know what's going wrong here, but it sounds like a problem with your
> network. Epiphany just downloads the filters from EasyList, that's all there
> is to it.

i have perfect network all site, but in epiphany 3.22 from zesty repositories ubuntu not work adblock. i look repository precise ubuntu and see epiphany 3.4 but this package no work without xwayland.

i run epiphany with xwayland but no work adblock also

i no know what do and and dont know how look where bug and me n0 joy this suite.
i like use epiphany without xwayland, i want remove xwayland from my system but i no can becouse alweys use adblock in other browser very many adds in net.
Comment 10 what103 2017-01-13 10:54:09 UTC
if run epiphany from terminal show it

(WebKitWebProcess:5230): WARNING **: Error retrieving adblock filter: no supported
Comment 11 Michael Catanzaro 2017-01-13 15:52:19 UTC
(In reply to what103 from comment #10)
> if run epiphany from terminal show it
> 
> (WebKitWebProcess:5230): WARNING **: Error retrieving adblock filter: no
> supported

Wow....

The filters are downloaded via g_file_copy() [1]. I guess g_file_copy() is returning G_IO_ERROR_NOT_SUPPORTED, which is documented as "Operation (or one of its parameters) not supported". So I think it means gvfs can't download http://. Let's find out; try running this command:

gvfs-copy http://example.com ./test.html

That should download example.com to the file ./test.html. If that doesn't work, then you at least have a simpler problem to solve.

[1] https://git.gnome.org/browse/epiphany/tree/embed/web-extension/ephy-uri-tester.c?h=gnome-3-22#n116
Comment 12 what103 2017-01-14 02:15:04 UTC
very big thanks, you make understand me.
yes gvfs-copy no suport my system, because gvfs not install, but i no want install because gvfs package need x11-common and x11-utils but this packages not install because i am use weston without xwayland and no have excess packages in my system.

my system this epiphany, gedit, gnome-terminl, weston, alsa-utils, gstreamer with alsa end.

only 584 packages ubuntu zesty mini.iso is my work system. because i no get adblock in epipany without gvfs no joy me sry.
Comment 13 what103 2017-01-14 02:16:40 UTC
i can have other alternativs without gvfs-copy in epiphany and get work adblock?
thanks.
Comment 14 Michael Catanzaro 2017-01-14 02:33:20 UTC
Nope... lots of GNOME apps depend on gvfs. You might want to file a new bug against gvfs about the X11 dependency.
Comment 15 what103 2017-01-14 02:41:51 UTC
(In reply to Michael Catanzaro from comment #14)
> Nope... lots of GNOME apps depend on gvfs. You might want to file a new bug
> against gvfs about the X11 dependency.

and they say me what many app depnd gvfs have depend x11. okay i am understand.
but very big thank for your reply.

but i want know is realy best hack make supported adblock in epiphany with help gvfs-copy?
Comment 16 Carlos Garcia Campos 2017-01-15 08:46:46 UTC
We could use an internal ephy-download for this, the same way it's used for other features like set image as bakcground. g_file_copy is very useful when you don't want to care about whether it's a local file or remote, but in this case we always know we are downloading the filters from HTTP.
Comment 17 what103 2017-01-15 10:19:58 UTC
okay reasonably, but i read forums about epiphany with this speach and many peoples want have make manual add rule in file adblock in epiphany. if we take chrome or ff and look ublock settings, we see what this app have this and user can add rule manual.

why you no want give users this hack? is very difectly or for security no good?

but you can add choice manualy or automatic.
Comment 18 what103 2017-01-15 12:58:33 UTC
now i do it.

install xwayland and gvfs with all depend, login in weston with support xwayland in weston.ini, run epiphany, and get hex file ab filters, more i copy filter and hex files for backup other directory, remove gvfs with depend and xwayland. and i get work adblock rules in native wayland epiphany. 

ps but i think is no better what maby be.
all very thanks for reply, but gvfs tools use for work ab is no better idea imha.
Comment 19 Michael Catanzaro 2017-01-15 22:19:22 UTC
(In reply to what103 from comment #17)
> okay reasonably, but i read forums about epiphany with this speach and many
> peoples want have make manual add rule in file adblock in epiphany. if we
> take chrome or ff and look ublock settings, we see what this app have this
> and user can add rule manual.
> 
> why you no want give users this hack? is very difectly or for security no
> good?
> 
> but you can add choice manualy or automatic.

It's something we want to do, see bug #755193.

(In reply to Carlos Garcia Campos from comment #16)
> We could use an internal ephy-download for this, the same way it's used for
> other features like set image as bakcground. g_file_copy is very useful when
> you don't want to care about whether it's a local file or remote, but in
> this case we always know we are downloading the filters from HTTP.

That would be better, yes. That way the correctness does not depend on us never using WebKitProxyManager or something.
Comment 20 Michael Catanzaro 2017-01-15 22:25:03 UTC
(Note: changing this requires adding a mechanism to indicate that an EphyDownload should never be displayed to the user in EphyDownloadsPopover.)
Comment 21 what103 2017-01-16 01:58:27 UTC
(In reply to Michael Catanzaro from comment #20)
> (Note: changing this requires adding a mechanism to indicate that an
> EphyDownload should never be displayed to the user in EphyDownloadsPopover.)

chin-chin for progress! :)
Comment 22 Carlos Garcia Campos 2017-01-16 06:53:24 UTC
(In reply to Michael Catanzaro from comment #20)
> (Note: changing this requires adding a mechanism to indicate that an
> EphyDownload should never be displayed to the user in EphyDownloadsPopover.)

We already have that, or at least we used to.
Comment 23 Michael Catanzaro 2017-01-23 17:17:12 UTC
Created attachment 344054 [details] [review]
(Broken) use EphyDownload to download adblock filters

Note: it's broken and creates only 0-byte files
Comment 24 Michael Catanzaro 2017-01-23 17:18:03 UTC
Created attachment 344055 [details] [review]
(Broken) use EphyDownload to download adblock filters

Note: it's broken and creates only 0-byte files
Comment 25 what103 2017-01-23 19:35:27 UTC
is no fun. but epiphany good simple browser iam use it now. maby more gvfs remove depend x11-common and all stay very good.
Comment 26 what103 2017-02-03 12:04:03 UTC
very big thankyou :) i think very soon is patch be in ubuntu version.

if epiphany more think about aspell depends for move in recomendad is very good.
i not use aspell and check text and think what if very small depends is very good becouse for me is good.
Comment 27 what103 2017-02-03 12:14:34 UTC
oops, i not undertand word broken, but now know.
i do all what can :)
Comment 28 what103 2017-03-12 03:04:28 UTC
now if add url filters in dconf-editor, then get hex files in .config/epiphany/adblock/ for every url from dconf-editor, but when start browser through terminal get this

** (epiphany:3882): WARNING **: Error retrieving filter https://easylist-downloads.adblockplus.org/antiadblockfilters.txt: Operation not supported
Comment 29 Michael Catanzaro 2017-11-15 02:10:59 UTC
The following fix has been pushed:
6e9137f Use EphyDownload to download adblock filters
Comment 30 Michael Catanzaro 2017-11-15 02:11:07 UTC
Created attachment 363649 [details] [review]
Use EphyDownload to download adblock filters

Instead of using gvfs. This means that the adblocker now works even if
gvfsd-http is not running. In particular, it should now (hopefully) work
under Flatpak.