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 755379 - Each Epiphany app instance downloads its own adblock filters list
Each Epiphany app instance downloads its own adblock filters list
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
3.16.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: Michael Catanzaro
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-22 02:37 UTC by Jean-François Fortin Tam
Modified: 2016-12-24 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (70.07 KB, image/png)
2015-09-22 02:37 UTC, Jean-François Fortin Tam
  Details
uri-tester: Steal adblock filters from default profile in app mode (1.57 KB, patch)
2016-10-29 21:13 UTC, Michael Catanzaro
committed Details | Review

Description Jean-François Fortin Tam 2015-09-22 02:37:45 UTC
Created attachment 311816 [details]
screenshot

As you can see in the attached screenshot from ~/.config/epiphany, Web saves and update a complete EasyList adblock filter list for not just the main profile, but also every "web app" instances... which seems quite inefficient to me, as it means it needs to download/update ~1.6 MB+ of filters on every startup for those instances, while it's the exact same file as the main instance (heck, it could just be a soft relative symbolic link to the parent...)
Comment 1 Michael Catanzaro 2016-02-23 13:31:14 UTC
Since AdBlock filters are big (1.7 MB nowadays), we need to write a profile migrator to delete filters from existing profile directories when fixing this bug.
Comment 2 Michael Catanzaro 2016-10-29 21:12:31 UTC
(In reply to Michael Catanzaro from comment #1)
> Since AdBlock filters are big (1.7 MB nowadays), we need to write a profile
> migrator to delete filters from existing profile directories when fixing
> this bug.

I'm going to be lazy and not do this, it's not so big.
Comment 3 Michael Catanzaro 2016-10-29 21:13:12 UTC
The following fix has been pushed:
03d53f0 uri-tester: Steal adblock filters from default profile in app mode
Comment 4 Michael Catanzaro 2016-10-29 21:13:15 UTC
Created attachment 338781 [details] [review]
uri-tester: Steal adblock filters from default profile in app mode

Since adblock filters are big, we don't want to keep a separate copy for
each app. This became easy to implement after moving EphyUriTester to
the UI process.
Comment 5 Allison Karlitskaya (desrt) 2016-12-19 19:37:33 UTC
Does it make sense to move this to XDG_CACHE_HOME instead?  It's not anything close to being configuration data.
Comment 6 Michael Catanzaro 2016-12-19 21:28:52 UTC
Yes it does.

That touches on a longstanding issue we have to figure out... we have a bunch of stuff under our profile directory in XDG_CONFIG_HOME that should move to XDG_DATA_HOME (or I guess in this case, XDG_CACHE_HOME indeed). But currently Epiphany stores all its profile data in a single directory, so we'd have to change this and modify several places in the code. Basically, we'd have to replace ephy_dot_dir() with new functions ephy_profile_config_dir(), ephy_profile_data_dir(), ephy_profile_cache_dir(). That's another bug entirely, though.
Comment 7 Allison Karlitskaya (desrt) 2016-12-23 14:37:54 UTC
fwiw, I've stopped thinking that ~/.local/share/ is a good place for "random app data" some time ago.  ~/.var/app/org.gnome.ephy/ is my preferred place for this stuff these days (which is the convention that flatpak also follows).

Of course, we should probably introduce some new fancy XDG_STATE_HOME envvar or something for this.

To answer the obvious question: although I've discussed this with a lot of people, I've never written it down anywhere or proposed it to the XDG spec.  :(
Comment 8 Michael Catanzaro 2016-12-23 18:22:46 UTC
(In reply to Allison Lortie (desrt) from comment #7)
> fwiw, I've stopped thinking that ~/.local/share/ is a good place for "random
> app data" some time ago.  ~/.var/app/org.gnome.ephy/ is my preferred place
> for this stuff these days (which is the convention that flatpak also
> follows).

...why? XDG_DATA_HOME is established convention at this point, why move it somewhere else...?
Comment 9 Allison Karlitskaya (desrt) 2016-12-24 16:28:59 UTC
See https://lists.freedesktop.org/archives/xdg/2016-December/013803.html for some more motivation/background.