If the database is broken in whatever way the pointer is
unset. A good next step would be to give more user-friendly
feedback than the current rough dialog.
If the session is not prepared properly URIs loading of
the first page(s) breaks. Also it is a good idea to sort
out all settings before loading anything to begin with.
You will now see "midori_load_soup_session was not called!" if
any pages try to load before the session is prepared.
Fixes: https://bugs.launchpad.net/midori/+bug/814268
The web cache extension is automatically hidden/ disabled if
WebKitGTK+ is new enough, the new cache is a core feature.
By default 100 MB of pages can be cached on disk.
The 'Applications' preference tab is resurrected.
The same folder ~/.cache/midori/web is used for old and new cache.
So prefetching in private mode is disabled regardless of
whether prefetching is done in Midori or in new WebKit
versions.
Menu items also adhere to that same setting now.
And use the chance to correct version checks.
This new feature strips, if enabled, the path and query from
the 'Referer' header when switching to external sites. It
doesn't affect internal links, which is why websites testing
for this feature may falsely assert it's not working.
The feature is automatically enabled in private mode.
The soup session preparation was actually several incomplete
in app mode, now it shares a common code path with normal
mode minus web cookies and logins.
MidoriBrowser gains the show-preferences signal which
gives API users a chance to add preferences.
katze_preferences_add_category now returns a box to
allow freely packing a widget into the page.
The extension panel is packed into the preferences now
rather than being appended as a proper panel.
Motivation is consistency here, such as with Gedit or
Emerillon and also the aspect that extensions often
really do tweak behaviour like preferences do.
Spacing and icons are added for visual consistency.
Private mode gets a particular window title, always defaults
to reading the default config folder but never saves data.
App mode applies a custom window layout with no toolbars
and using the page icon as the window icon.
From now on private and app are independant modes, so apps
can save data if config is given. Both can also be combined.
So app mode with a config folder uses the same code paths
as normal browsing.
This means accelerators and search engines are available
in Private Browsing now.
The new function allows registering callbacks which clear data,
with a name and label so they show up in the Clear Private Data
dialogue and the chosen items are saved.
The old enumeration still keeps history, trash and the flag
whether to clear when Midori quits.
The variable MIDORI_COOKIES_DEBUG can be used to print
the number of updated cookies when they're written.
The temporary cookie file is written in the same location
now as moving across filesystems may not work.
Saving when Midori is quit is enforced.
Iterating an array by a GList is considerably faster than
continuously retrieving items, however it is also a lot
more complicated. So the new macro takes care of that and
uses a new semi-private function to avoid copying the list.
Note that the macro can't be nested, which basically isn't
useful in practise anyway.
The panel and the bookmarkbar need to monitor the removal of
bookmarks, and there can be multiple windows, so the database
should only be used to remove in one central place.
Each view has a meta value 'delay' which indicates whether it be
loaded or needs to be loaded manually before it shows content.
One way to trigger this is that Midori crashes and if it is
configured to 'Show last open tabs', all tabs will now be
delayed. To allow Midori to safely open without crashing again.
The other way is to change the 'Load on Startup' preference to
'Show last tabs without loading'. This causes all tabs restored
from the session to be delayed.
One interesting aspect is that it is possible to have delayed
tabs, use 'Show last open tabs' and tabs will remain as they are,
so delayed tabs will be delayed over following sessions.
The flag in the SoupMessage to verify secure connections is
only available in recent versions of libsoup. So we continue
to be oblivious to certificates with older versions.
If one of two known root certificate files is available, we
enable certificate validation, otherwise a warning is emitted.
Not using validation means that we trust any certificate. We
should consider doing the opposite.
The new property MidoriView:security is set during load
and indicates the security status. midori_view_get_security can
be used to determine the status later on.
midori_location_action_set_security_hint is implemented to
present security status visually. For now, this only changes
the icon, we need to find a more visible solution.
MidoriBrowser updates the security hint for the current view in
_midori_browser_update_interface.
Using a regular expression of blocked URIs makes it possible to
restrict the locations that can be visited. Any URI matching
the expression will be replaced with "http://.invalid".
The option works in --app and normal mode.
The extension is only needed for the --inactivity-reset option,
so most users building Midori won't need it.
We also need to check for the according header file.
The use case is kiosk systems where leaving the application
idle for a period of time means that the user left, and the
session is reset so the next user starts off clean.
The implementation uses libXss and uses XScreenSaverQueryExtension
which means it is for now supported on X11 only.
Right now reset means closing any opens web pages and opening
the original web page.
Currently --inactivity-reset is only supported with --app.
We shouldn't honor user preferences for new tabs when loading
the session. Rather we append in the order they were saved in.
This is currently a hack. In the future we should consider
public API additions to insert tabs in a particular order.
We intentionally set a timeout before saving changes to avoid
continuous disc access and also in case opening or closing a tab
results in an immediate crash or freezing.
But closing Midori normally should save outstanding changes.