7e86a0c...
by
Michael Catanzaro <email address hidden>
Don't accidentally delete adblock filters
The uri-tester is created from the web extension. When created, it opens
~/.config/epiphany/adblock/filters.list for reading in
uri_tester_load_filters(), then calls uri_tester_set_filters() with the
read filters. uri_tester_set_filters() unconditionally calls
uri_tester_save_filters(), so we immediately write back what we read to
filters.list. But this is racy: if you are starting multiple web
processes at the same time, such as when opening epiphany with multiple
saved tabs, then one process may open the file for reading after another
has opened it for writing (which clears the file) but before the filters
have been written back to the file, so now one UriTester instance has an
empty list of filters, and it will immediately write back that empty list.
The original list is completely doomed because the only time we ever
write to filters.list is immediately after the filters are read, since
we do not support modifying filters. That's right, these writes are
NEVER necessary, so let's just remove them completely so we can be
completely sure the problem is gone.
Now we have an ununsued uri_tester_save_filters() function, but I don't
want to get rid of it quite yet as I do want to support at least a
couple different types of filters in the future (for tracking
protection). Also, there are already other unused functions here as
well, so one more is no difference for now, but refactor is imminent.
4a66cc5...
by
Gustavo Noronha Silva <email address hidden>
Use a flag to decide if a tab is download-only
There are some cases in which a view may not be able to go back and still be not
just for a download: if the view has been opened by middle clicking somewhere or
by having an URL provided on startup, then the navigation from the overview to
the first page won't have happened. By tracking whether the page has ever
committed a load we can be sure it has been opened just for the download.
74a842c...
by
Gustavo Noronha Silva <email address hidden>
If a tab is created only for a download, close it
If a tab that has just been created ends up being just a download, then
close it down. If it's the only one on the window, then make it show the
overview instead.