...
 
Commits (130)
3.26.7 - June 7, 2018
=====================
- Ensure search engine migration does not fail (#794645)
- Do not open adblock filters when automatic open downloads is enabled (#794646)
- Fix crash destroying sync service (#794728)
- Fix CVE-2018-11396/CVE-2018-12016 (#795740)
- Do not use Fanboy's Annoyance adblock list by default (#796245)
- Fix a couple sync service crashers (Gabriel Ivascu)
3.26.6 - February 13, 2018
==========================
- Fix download of blob URIs (#788576)
- Fix WhatsApp web app (#790781, Jonathan Kang)
- Fix profile migrator deleting bookmarks if run multiple times (#792683)
- Add touch support for address bar icons (#792876, Jan-Michael Brummer)
- Fix placement of select element with multiple monitors (#792940, Jan-Michael Brummer)
- Hopefully fix the search provider (Bjørn Lie)
3.26.5.1 - December 21, 2017
============================
- Correct logic to avoid corrupting session state
3.26.5 - December 17, 2017
==========================
- Fix error in sync migration when migrating from 3.26.2 or earlier
- Improved logic to avoid corrupting session state
3.26.4 - December 12, 2017
==========================
- Fix sync failure warnings appearing multiple times (#790094)
- Fix tab sync and device name on accounts.firefox.com (#790370)
- Make default sync device name translatable (#790905)
- Several additional misc. improvements to sync support (including #790819)
- Flatpak: custom stylesheets are now supported
- Flatpak: view page source is now supported
3.26.3 - November 23, 2017
==========================
- Don't require gvfsd-http for downloading adblock filters (#776682)
- Several improvements to Sync support (including #789656, #789786, #790286)
- Make downloads work when running in flatpak (#785655)
- Do not add bookmarks to unrelated tag view popovers (#788584)
- Fix middle click on forward/back buttons (#790017)
- "Search the Web for ..." context menu option now switches to new tab (#790693)
3.26.2 - October 26, 2017
=========================
- Do not show home button if home page is set to blank page (#783299)
- Add support for remote inspector (an advanced developer tool)
- Various flatpak-related improvements (there's much more remaining to do)
- Add flatpak manifest
3.26.1 - September 29, 2017
===========================
- Fix search engine dialog, which has been borked since 3.24.3 (#787458)
- Allow overriding autofilled username in password forms (#787498)
- Fix non-HTML/MHTML files being saved as MHTML (#788111)
- Don't disable navigation actions when history is cleared (#788329)
- Fix bookmarks import crash when there's no Firefox profile
3.26.0 - September 8, 2017
==========================
......
......@@ -19,14 +19,23 @@ i18n.merge_file('appdata-file',
po_dir: '../po'
)
# We need three custom_target() calls because Meson doesn't have very
# good support for GSettings yet. First, generate our GSettings enums
# in the build directory. Then, copy the gschema into the build
# directory to ensure it is in the same place as the enums file. Then
# we can run glib-compile-schemas on it. We have to compile schemas in
# the build directory to ensure that our tests don't fail if run on a
# system where epiphany is not already installed. epiphany will also
# look for schemas here if built in developer mode.
#
# https://github.com/mesonbuild/meson/issues/1687
custom_target('gsettings-enums',
generate_enums = custom_target('gsettings-enums',
input: '../lib/ephy-prefs.h',
output: 'org.gnome.Epiphany.enums.xml',
install: true,
install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
capture: true,
command: ['glib-mkenums',
command: [find_program('glib-mkenums'),
'--comments', '<!-- @comment@ -->',
'--fhead', '<schemalist>',
'--vhead', ' <@type@ id="org.gnome.Epiphany.@EnumName@">',
......@@ -36,6 +45,19 @@ custom_target('gsettings-enums',
'@INPUT@'
]
)
copy_gschema = custom_target('copy-gschema-to-builddir',
input: 'org.gnome.epiphany.gschema.xml',
output: 'renamed-hack.gschema.xml',
command: ['cp', '@INPUT@', '@OUTPUT@']
)
compile_schemas = custom_target('glib-compile-schemas',
output: 'gschemas.compiled',
install: false,
command: [find_program('glib-compile-schemas'),
meson.current_build_dir()
],
depends: [generate_enums, copy_gschema]
)
install_data('org.gnome.epiphany.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
)
......@@ -43,13 +65,13 @@ install_data('org.gnome.epiphany.gschema.xml',
serviceconf = configuration_data()
serviceconf.set('libexecdir', libexecdir)
configure_file(
input: 'org.gnome.EpiphanySearchProvider.service.in',
output: 'org.gnome.EpiphanySearchProvider.service',
input: 'org.gnome.Epiphany.SearchProvider.service.in',
output: 'org.gnome.Epiphany.SearchProvider.service',
configuration: serviceconf,
install: true,
install_dir: join_paths(datadir, 'dbus-1', 'services')
)
install_data('epiphany-search-provider.ini',
install_data('org.gnome.Epiphany.search-provider.ini',
install_dir: join_paths(datadir, 'gnome-shell', 'search-providers')
)
......
[D-BUS Service]
Name=org.gnome.EpiphanySearchProvider
Name=org.gnome.Epiphany.SearchProvider
Exec=@libexecdir@/epiphany-search-provider
[Shell Search Provider]
DesktopId=org.gnome.Epiphany.desktop
BusName=org.gnome.EpiphanySearchProvider
ObjectPath=/org/gnome/EpiphanySearchProvider
BusName=org.gnome.Epiphany.SearchProvider
ObjectPath=/org/gnome/Epiphany/SearchProvider
Version=2
......@@ -101,7 +101,7 @@
</key>
<key type="as" name="adblock-filters">
<default>['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist.to/easylist/fanboy-annoyance.txt']</default>
<default>['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt']</default>
<summary>List of adblock filters</summary>
<description>List of URLs with filter rules to be used by the adblock.</description>
</key>
......@@ -271,7 +271,7 @@
<default>false</default>
</key>
</schema>
<schema path="/org/gnome/Epiphany/sync/" id="org.gnome.Epiphany.sync">
<schema path="/org/gnome/epiphany/sync/" id="org.gnome.Epiphany.sync">
<key type="s" name="sync-user">
<default>''</default>
<summary>Currently signed in sync user</summary>
......@@ -307,7 +307,7 @@
<summary>Enable bookmarks sync</summary>
<description>TRUE if bookmarks collection should be synced, FALSE otherwise.</description>
</key>
<key type="d" name="sync-bookmarks-time">
<key type="x" name="sync-bookmarks-time">
<default>0</default>
<summary>Bookmarks sync timestamp</summary>
<description>The timestamp at which last bookmarks sync was made.</description>
......@@ -322,7 +322,7 @@
<summary>Enable passwords sync</summary>
<description>TRUE if passwords collection should be synced, FALSE otherwise.</description>
</key>
<key type="d" name="sync-passwords-time">
<key type="x" name="sync-passwords-time">
<default>0</default>
<summary>Passwords sync timestamp</summary>
<description>The timestamp at which last passwords sync was made.</description>
......@@ -337,7 +337,7 @@
<summary>Enable history sync</summary>
<description>TRUE if history collection should be synced, FALSE otherwise.</description>
</key>
<key type="d" name="sync-history-time">
<key type="x" name="sync-history-time">
<default>0</default>
<summary>History sync timestamp</summary>
<description>The timestamp at which last history sync was made.</description>
......@@ -352,12 +352,99 @@
<summary>Enable open tabs sync</summary>
<description>TRUE if open tabs collection should be synced, FALSE otherwise.</description>
</key>
<key type="d" name="sync-open-tabs-time">
<key type="x" name="sync-open-tabs-time">
<default>0</default>
<summary>Open tabs sync timestamp</summary>
<description>The timestamp at which last open tabs sync was made.</description>
</key>
</schema>
<schema path="/org/gnome/Epiphany/sync/" id="org.gnome.Epiphany.sync.DEPRECATED">
<key type="s" name="sync-user">
<default>''</default>
<summary>Currently signed in sync user</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="x" name="sync-time">
<default>0</default>
<summary>Last sync timestamp</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="s" name="sync-device-id">
<default>''</default>
<summary>Sync device ID</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="s" name="sync-device-name">
<default>''</default>
<summary>Sync device name</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="u" name="sync-frequency">
<default>30</default>
<summary>The sync frequency in minutes</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-with-firefox">
<default>true</default>
<summary>Sync data with Firefox</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-bookmarks-enabled">
<default>false</default>
<summary>Enable bookmarks sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="d" name="sync-bookmarks-time">
<default>0</default>
<summary>Bookmarks sync timestamp</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-bookmarks-initial">
<default>true</default>
<summary>Initial sync or normal sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-passwords-enabled">
<default>false</default>
<summary>Enable passwords sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="d" name="sync-passwords-time">
<default>0</default>
<summary>Passwords sync timestamp</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-passwords-initial">
<default>true</default>
<summary>Initial sync or normal sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-history-enabled">
<default>false</default>
<summary>Enable history sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="d" name="sync-history-time">
<default>0</default>
<summary>History sync timestamp</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-history-initial">
<default>true</default>
<summary>Initial sync or normal sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="b" name="sync-open-tabs-enabled">
<default>false</default>
<summary>Enable open tabs sync</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
<key type="d" name="sync-open-tabs-time">
<default>0</default>
<summary>Open tabs sync timestamp</summary>
<description>DEPRECATED: This key is deprecated and ignored. Use /org/gnome/epiphany/sync/ instead.</description>
</key>
</schema>
<enum id="org.gnome.Epiphany.Permission">
<value nick="undecided" value="-1"/>
<value nick="deny" value="0"/>
......
......@@ -25,6 +25,7 @@
#include "ephy-embed-prefs.h"
#include "ephy-embed-utils.h"
#include "ephy-file-helpers.h"
#include "ephy-flatpak-utils.h"
#include "ephy-history-service.h"
#include "ephy-prefs.h"
#include "ephy-settings.h"
......@@ -620,7 +621,7 @@ ephy_about_handler_handle_request (EphyAboutHandler *handler,
handled = ephy_about_handler_handle_memory (handler, request);
else if (!g_strcmp0 (path, "epiphany"))
handled = ephy_about_handler_handle_epiphany (handler, request);
else if (!g_strcmp0 (path, "applications"))
else if (!g_strcmp0 (path, "applications") && !ephy_is_running_inside_flatpak ())
handled = ephy_about_handler_handle_applications (handler, request);
else if (!g_strcmp0 (path, "overview"))
handled = ephy_about_handler_handle_html_overview (handler, request);
......
......@@ -449,6 +449,10 @@ ephy_download_do_download_action (EphyDownload *download,
LOG ("ephy_download_do_download_action: none");
ret = TRUE;
break;
case EPHY_DOWNLOAD_ACTION_DO_NOT_AUTO_OPEN:
LOG ("ephy_download_do_download_action: do_not_auto_open");
ret = TRUE;
break;
default:
g_assert_not_reached ();
}
......@@ -687,13 +691,14 @@ download_finished_cb (WebKitDownload *wk_download,
EphyDownload *download)
{
download->finished = TRUE;
g_signal_emit (download, signals[COMPLETED], 0);
if (g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_AUTO_DOWNLOADS) &&
download->action == EPHY_DOWNLOAD_ACTION_NONE)
ephy_download_do_download_action (download, EPHY_DOWNLOAD_ACTION_OPEN, download->start_time);
else
ephy_download_do_download_action (download, download->action, download->start_time);
g_signal_emit (download, signals[COMPLETED], 0);
}
static void
......
......@@ -33,7 +33,8 @@ typedef enum
{
EPHY_DOWNLOAD_ACTION_NONE,
EPHY_DOWNLOAD_ACTION_BROWSE_TO,
EPHY_DOWNLOAD_ACTION_OPEN
EPHY_DOWNLOAD_ACTION_OPEN,
EPHY_DOWNLOAD_ACTION_DO_NOT_AUTO_OPEN
} EphyDownloadActionType;
EphyDownload *ephy_download_new (WebKitDownload *download);
......
......@@ -32,6 +32,7 @@
#include "ephy-encodings.h"
#include "ephy-file-helpers.h"
#include "ephy-filters-manager.h"
#include "ephy-flatpak-utils.h"
#include "ephy-history-service.h"
#include "ephy-profile-utils.h"
#include "ephy-settings.h"
......@@ -930,10 +931,6 @@ ephy_embed_shell_startup (GApplication *application)
G_APPLICATION_CLASS (ephy_embed_shell_parent_class)->startup (application);
filters_dir = adblock_filters_dir (shell);
priv->filters_manager = ephy_filters_manager_new (filters_dir);
g_free (filters_dir);
ephy_embed_shell_create_web_context (shell);
ephy_embed_shell_setup_web_extensions_server (shell);
......@@ -1029,6 +1026,10 @@ ephy_embed_shell_startup (GApplication *application)
ephy_embed_prefs_set_cookie_accept_policy (cookie_manager, cookie_policy);
g_free (cookie_policy);
filters_dir = adblock_filters_dir (shell);
priv->filters_manager = ephy_filters_manager_new (filters_dir);
g_free (filters_dir);
#if ENABLE_HTTPS_EVERYWHERE
/* We might want to be smarter about this in the future. For now,
* trigger an update of the rulesets once each time Epiphany is started.
......@@ -1444,6 +1445,10 @@ ephy_embed_shell_launch_handler (EphyEmbedShell *shell,
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), FALSE);
g_return_val_if_fail (file || mime_type, FALSE);
if (ephy_is_running_inside_flatpak ()) {
return ephy_file_launch_file_via_uri_handler (file);
}
app = ephy_file_launcher_get_app_info_for_file (file, mime_type);
/* Do not allow recursive calls into the browser, they can lead to
......
......@@ -126,9 +126,11 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
g_ascii_strncasecmp (address, "file", colonpos) &&
g_ascii_strncasecmp (address, "javascript", colonpos) &&
g_ascii_strncasecmp (address, "data", colonpos) &&
g_ascii_strncasecmp (address, "blob", colonpos) &&
g_ascii_strncasecmp (address, "about", colonpos) &&
g_ascii_strncasecmp (address, "ephy-about", colonpos) &&
g_ascii_strncasecmp (address, "gopher", colonpos));
g_ascii_strncasecmp (address, "gopher", colonpos) &&
g_ascii_strncasecmp (address, "inspector", colonpos));
return has_web_scheme;
}
......@@ -276,7 +278,7 @@ ephy_embed_utils_autosearch_address (const char *search_key)
shell = ephy_embed_shell_get_default ();
search_engine_manager = ephy_embed_shell_get_search_engine_manager (shell);
address_search = ephy_search_engine_manager_get_address_for_default_engine (search_engine_manager);
address_search = ephy_search_engine_manager_get_default_search_address (search_engine_manager);
query_param = soup_form_encode ("q", search_key, NULL);
#pragma GCC diagnostic push
......
......@@ -980,6 +980,6 @@ ephy_embed_detach_notification_container (EphyEmbed *embed)
* notification widget, removing it from the container will destroy the
* singleton. To prevent this, add a reference to it before removing it
* from the container. */
gtk_container_remove (GTK_CONTAINER (embed->overlay), g_object_ref (container));
gtk_container_remove (GTK_CONTAINER (embed->overlay), g_object_ref (GTK_WIDGET (container)));
}
}
......@@ -21,6 +21,7 @@
#include "config.h"
#include "ephy-filters-manager.h"
#include "ephy-download.h"
#include "ephy-prefs.h"
#include "ephy-settings.h"
#include "ephy-uri-tester-shared.h"
......@@ -80,31 +81,20 @@ adblock_filter_file_is_valid (GFile *file)
typedef struct {
EphyFiltersManager *manager;
char *src_uri;
GFile *filter_file;
GFile *tmp_file;
EphyDownload *download;
char *source_uri;
} AdblockFilterRetrieveData;
static AdblockFilterRetrieveData *
adblock_filter_retrieve_data_new (EphyFiltersManager *manager,
GFile *src_file,
GFile *filter_file)
EphyDownload *download,
char *source_uri)
{
AdblockFilterRetrieveData* data;
char *path, *tmp_path;
data = g_slice_new (AdblockFilterRetrieveData);
data->manager = g_object_ref (manager);
data->src_uri = g_file_get_uri (src_file);
data->filter_file = g_object_ref (filter_file);
path = g_file_get_path (filter_file);
tmp_path = g_strdup_printf ("%s.tmp", path);
g_free (path);
data->tmp_file = g_file_new_for_path (tmp_path);
g_free (tmp_path);
data->download = g_object_ref (download);
data->source_uri = g_strdup (source_uri);
return data;
}
......@@ -112,57 +102,67 @@ static void
adblock_filter_retrieve_data_free (AdblockFilterRetrieveData *data)
{
g_object_unref (data->manager);
g_object_unref (data->filter_file);
g_object_unref (data->tmp_file);
g_free (data->src_uri);
g_object_unref (data->download);
g_free (data->source_uri);
g_slice_free (AdblockFilterRetrieveData, data);
}
static void
retrieve_filter_file_finished (GFile *src,
GAsyncResult *result,
AdblockFilterRetrieveData *data)
download_completed_cb (EphyDownload *download,
AdblockFilterRetrieveData *data)
{
GError *error = NULL;
g_signal_handlers_disconnect_by_data (download, data);
adblock_filter_retrieve_data_free (data);
}
if (!g_file_copy_finish (src, result, &error) ||
!g_file_move (data->tmp_file, data->filter_file, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error)) {
GFileOutputStream *stream;
static void
download_error_cb (EphyDownload *download,
GError *error,
AdblockFilterRetrieveData *data)
{
GFileOutputStream *stream;
GFile *file;
/* If failed to retrieve, create an empty file if it doesn't exist to unblock extensions */
stream = g_file_create (data->filter_file, G_FILE_CREATE_NONE, NULL, NULL);
if (stream)
g_object_unref (stream);
/* Create an empty file if it doesn't exist to unblock extensions */
file = g_file_new_for_uri (ephy_download_get_destination_uri (download));
stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL);
if (stream)
g_object_unref (stream);
g_object_unref (file);
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error retrieving filter %s: %s\n", data->src_uri, error->message);
g_error_free (error);
}
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error retrieving filter %s: %s\n", data->source_uri, error->message);
g_signal_handlers_disconnect_by_data (download, data);
adblock_filter_retrieve_data_free (data);
}
static void
retrieve_filter_file (EphyFiltersManager *manager,
const char *filter_url,
GFile *file)
start_retrieving_filter_file (EphyFiltersManager *manager,
const char *filter_url,
GFile *destination)
{
GFile *src = g_file_new_for_uri (filter_url);
EphyDownload *download;
WebKitDownload *wk_download;
AdblockFilterRetrieveData *data;
char *path;
download = ephy_download_new_for_uri (filter_url);
ephy_download_set_action (download, EPHY_DOWNLOAD_ACTION_DO_NOT_AUTO_OPEN);
path = g_file_get_uri (destination);
ephy_download_set_destination_uri (download, path);
g_free (path);
data = adblock_filter_retrieve_data_new (manager, src, file);
wk_download = ephy_download_get_webkit_download (download);
webkit_download_set_allow_overwrite (wk_download, TRUE);
g_file_copy_async (src, data->tmp_file,
G_FILE_COPY_OVERWRITE,
G_PRIORITY_DEFAULT,
manager->cancellable,
NULL, NULL,
(GAsyncReadyCallback)retrieve_filter_file_finished,
data);
data = adblock_filter_retrieve_data_new (manager, download, g_strdup (filter_url));
g_object_unref (src);
g_signal_connect (download, "completed",
G_CALLBACK (download_completed_cb), data);
g_signal_connect (download, "error",
G_CALLBACK (download_error_cb), data);
g_object_unref (download);
}
static void
......@@ -246,7 +246,7 @@ update_adblock_filter_files (EphyFiltersManager *manager)
filter_file = ephy_uri_tester_get_adblock_filter_file (manager->filters_dir, filters[i]);
if (!adblock_filter_file_is_valid (filter_file))
retrieve_filter_file (manager, filters[i], filter_file);
start_retrieving_filter_file (manager, filters[i], filter_file);
files = g_list_prepend (files, filter_file);
}
......
......@@ -584,9 +584,7 @@ ephy_option_menu_popup (EphyOptionMenu *menu,
gtk_scrolled_window_set_min_content_height (swindow, n_items * height);
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL);
if (x < area.x)
x = area.x;
else if (x + menu_req.width > area.x + area.width)
if (x + menu_req.width > area.x + area.width)
x = area.x + area.width - menu_req.width;
if (y + rect->height + menu_req.height <= area.y + area.height ||
......@@ -595,6 +593,7 @@ ephy_option_menu_popup (EphyOptionMenu *menu,
} else {
y -= menu_req.height;
}
gtk_window_move (GTK_WINDOW (menu), x, y);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu->view));
......
......@@ -3240,7 +3240,6 @@ ephy_web_view_save_main_resource_cb (GFile *file,
(GAsyncReadyCallback)web_resource_get_data_cb,
output_stream);
}
/**
* ephy_web_view_save:
* @view: an #EphyWebView
......@@ -3258,16 +3257,15 @@ ephy_web_view_save (EphyWebView *view, const char *uri)
file = g_file_new_for_uri (uri);
if (g_str_has_suffix (uri, ".html")) {
if (g_str_has_suffix (uri, ".mhtml"))
webkit_web_view_save_to_file (WEBKIT_WEB_VIEW (view), file, WEBKIT_SAVE_MODE_MHTML,
NULL, NULL, NULL);
else
g_file_replace_async (file, NULL, FALSE,
G_FILE_CREATE_REPLACE_DESTINATION | G_FILE_CREATE_PRIVATE,
G_PRIORITY_DEFAULT, NULL,
(GAsyncReadyCallback)ephy_web_view_save_main_resource_cb,
view);
} else {
webkit_web_view_save_to_file (WEBKIT_WEB_VIEW (view), file, WEBKIT_SAVE_MODE_MHTML,
NULL, NULL, NULL);
}
g_object_unref (file);
}
......
......@@ -25,6 +25,7 @@ libephyembed_sources = [
'ephy-encoding.c',
'ephy-encodings.c',
'ephy-file-monitor.c',
'ephy-filters-manager.c',
'ephy-find-toolbar.c',
'ephy-option-menu.c',
'ephy-web-view.c',
......
......@@ -584,7 +584,7 @@ ephy_web_dom_utils_find_form_auth_elements (WebKitDOMHTMLFormElement *form,
g_strcmp0 (element_type, "tel") == 0 ||
g_strcmp0 (element_type, "url") == 0 ||
g_strcmp0 (element_type, "number") == 0) {
username_node = g_object_ref (element);
username_node = g_object_ref (WEBKIT_DOM_HTML_INPUT_ELEMENT (element));
g_free (element_type);
break;
}
......
......@@ -643,15 +643,6 @@ remove_user_choices (WebKitDOMDocument *document)
}
}
static gboolean
username_changed_cb (WebKitDOMNode *username_node,
WebKitDOMEvent *dom_event,
EphyEmbedFormAuth *form_auth)
{
pre_fill_form (form_auth);
return TRUE;
}
static gboolean
user_chosen_cb (WebKitDOMNode *li,
WebKitDOMEvent *dom_event,
......@@ -1189,11 +1180,6 @@ web_page_form_controls_associated (WebKitWebPage *web_page,
webkit_dom_event_target_add_event_listener (WEBKIT_DOM_EVENT_TARGET (form), "submit",
G_CALLBACK (form_submitted_cb), FALSE,
web_page);
if (username_node) {
webkit_dom_event_target_add_event_listener (WEBKIT_DOM_EVENT_TARGET (username_node), "blur",
G_CALLBACK (username_changed_cb), FALSE,
form_auth);
}
/* Plug in the user autocomplete */
origin = ephy_uri_to_security_origin (uri);
......@@ -1586,7 +1572,7 @@ ephy_prefs_sync_user_cb (GSettings *settings,
*/
if (ephy_sync_utils_user_is_signed_in ())
ephy_web_extension_create_sync_service (extension);
else
else if (extension->sync_service)
ephy_web_extension_destroy_sync_service (extension);
}
......
......@@ -7,17 +7,17 @@
#
msgid ""
msgstr ""
"Project-Id-Version: epiphany master\n"
"Project-Id-Version: epiphany gnome-3.26\n"
"POT-Creation-Date: 2017-07-31 11:47+0000\n"
"PO-Revision-Date: 2017-08-08 12:12+0200\n"
"PO-Revision-Date: 2017-10-30 16:26+0100\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
"Language-Team: čeština <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Gtranslator 2.91.6\n"
"X-Generator: Gtranslator 2.91.7\n"
#. Put one translator per line, in the form NAME <EMAIL>, YEAR1, YEAR2
msgctxt "_"
......@@ -30,7 +30,7 @@ msgstr ""
#: C/index.page:8
msgctxt "text"
msgid "Web help"
msgstr "Nápověda k aplikaci WWW"
msgstr "Nápověda k aplikaci Web"
#. (itstool) path: info/desc
#: C/index.page:15
......@@ -39,14 +39,14 @@ msgid ""
"browser. Get started with <app>Web</app> and learn about the available "
"features."
msgstr ""
"Aplikace <app>WWW</app>, dříve zmámá jako <app>Epiphany</app> je webový "
"prohlížeč pro GNOME. Začněte <app>WWW</app> používat a zjistěte, co všechno "
"Aplikace <app>Web</app>, dříve zmámá jako <app>Epiphany</app> je webový "
"prohlížeč pro GNOME. Začněte <app>Web</app> používat a zjistěte, co všechno "
"umí."
#. (itstool) path: page/title
#: C/index.page:21
msgid "<_:media-1/> Web"
msgstr "<_:media-1/> WWW"
msgstr "<_:media-1/> Web"
#. (itstool) path: section/title
#: C/index.page:27
......@@ -101,7 +101,8 @@ msgid ""
"An introduction to <app>Web</app>, a web browser for GNOME with built-in "
"privacy."
msgstr ""
"Úvod do <app>WWW</app>, webového prohlížeče pro GNOME s ochranou soukromí."
"Úvod do aplikace <app>Web</app>, webového prohlížeče pro GNOME s ochranou "
"soukromí."
#. (itstool) path: page/title
#: C/introduction.page:22
......@@ -114,14 +115,14 @@ msgid ""
"<app>Web</app> offers a simple and clean way to browse the internet. It "
"displays pages with the same speed and accuracy as other popular browsers."
msgstr ""
"<app>WWW</app> nabízí jednoduchý a přímý způsob, jak procházet Internet. "
"<app>Web</app> nabízí jednoduchý a přímý způsob, jak procházet Internet. "
"Zobrazuje stránky stejně rychle a správně, jako jiné populární prohlížeče."
#. (itstool) path: page/p
#: C/introduction.page:28
msgid ""
"<app>Web</app> is the application formerly known as <app>Epiphany</app>."
msgstr "<app>WWW</app> je aplikace dříve známá jako <app>Epiphany</app>."
msgstr "<app>Web</app> je aplikace dříve známá jako <app>Epiphany</app>."
#. (itstool) path: page/media
#. This is a reference to an external file such as an image or video. When
......@@ -141,7 +142,7 @@ msgid ""
"Fullscreen screenshot of Web with the Web wiki page open in the first tab "
"and showing the GNOME website open in the second tab."
msgstr ""
"Snímek obrazovky s aplikací WWW, ve které je v první kartě otevřena "
"Snímek obrazovky s aplikací Web, ve které je v první kartě otevřena "
"wikistránka této aplikace a v druhé zobrazena webová stránka GNOME."
#. (itstool) path: p/link
......@@ -157,7 +158,7 @@ msgstr "Toto dílo je licencováno pod <_:link-1/>."
#. (itstool) path: info/desc
#: C/browse-local.page:23
msgid "How do I view files which are on my computer in a web browser?"
msgstr "Jak v prohlížeči WWW zobrazím soubory uložené na svém počítači?"
msgstr "Jak v prohlížeči Web zobrazím soubory uložené na svém počítači?"
#. (itstool) path: page/title
#: C/browse-local.page:26
......@@ -171,8 +172,8 @@ msgid ""
"browser. This can be useful if you have saved a website for reading later or "
"want to preview a web page that you are creating."
msgstr ""
"Některé typy místních souborů si můžete prohlédnout v prohlížeči WWW. To je "
"užitečné, pokud jste si uložili stránku WWW k pozdějšímu přečtení nebo se "
"Některé typy místních souborů si můžete prohlédnout v prohlížeči Web. To je "
"užitečné, pokud jste si uložili stránku www k pozdějšímu přečtení nebo se "
"chcete podívat, jak vypadá stránka, již tvoříte."
#. (itstool) path: item/p
......@@ -227,13 +228,13 @@ msgid ""
"Select <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem\">New "
"Incognito Window</gui></guiseq>."
msgstr ""
"Zvolte <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem\">Nové "
"Zvolte <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem\">Nové "
"anonymní okno</gui></guiseq>."
#. (itstool) path: item/p
#: C/browse-private.page:55
msgid "Browse the web using incognito mode."
msgstr "Prohlížejte WWW v anonymním režimu."
msgstr "Prohlížejte weby v anonymním režimu."
#. (itstool) path: item/p
#: C/browse-private.page:58
......@@ -314,7 +315,7 @@ msgstr "Zobrazujte si webové stránky z Internetu."
#. (itstool) path: page/title
#: C/browse-web.page:29
msgid "Browse the web"
msgstr "Prohlížení WWW"
msgstr "Prohlížení webů"
#. (itstool) path: page/p
#: C/browse-web.page:31
......@@ -323,7 +324,7 @@ msgid ""
"Internet connection. To start browsing the web:"
msgstr ""
"Prohlížeče mohou být použity k zobrazování stránek na internetu, pokud je "
"dostupné internetové připojení. Abyste začali prohlížet WWW:"
"dostupné internetové připojení. Když chcete začít prohlížet webovou stránku:"
#. (itstool) path: item/p
#: C/browse-web.page:36
......@@ -332,7 +333,7 @@ msgid ""
"be in the text entry field at the top of the window. Type in the URL of the "
"webpage that you want to visit or your search term."
msgstr ""
"Když spustíte aplikaci <app xref=\"introduction\">WWW</app>, kurzor by měl "
"Když spustíte aplikaci <app xref=\"introduction\">Web</app>, kurzor by měl "
"být umístěn ve vstupním poli v horní části okna. Zadejte adresu URL stránky, "
"již chcete navštívit, nebo napište hledaný výraz."
......@@ -354,10 +355,10 @@ msgid ""
"the new tab is open, you can use it as you would normally use a new window."
msgstr ""
"<em>Karty</em> se používají k prohlížení více stránek v jednom okně. Po "
"prvním spuštění <app>WWW</app> nebudou zobrazeny žádné karty. <em>Novou "
"kartu otevřete</em> rozkliknutím nabídky v pravém horním rohu a zvolením "
"<guiseq><gui style=\"menuitem\">Nová karta</gui></guiseq>. Po jejím otevření "
"můžete s kartou zacházet, jako byste používali nové okno."
"prvním spuštění prohlížeče <app>Web</app> nebudou zobrazeny žádné karty. "
"<em>Novou kartu otevřete</em> rozkliknutím nabídky v pravém horním rohu a "
"zvolením <guiseq><gui style=\"menuitem\">Nová karta</gui></guiseq>. Po jejím "
"otevření můžete s kartou zacházet, jako byste používali nové okno."
#. (itstool) path: page/p
#. (itstool) id: browse-web.page#tabs-alt
......@@ -401,8 +402,8 @@ msgid ""
"\">Activities overview</link>. When you open a Web Application, it is shown "
"in a special type of window without the address bar or the menus."
msgstr ""
"Stránku WWW můžete uložit jako <em>webovou aplikaci</em>. Tím se odkaz na "
"danou stránku přidá do <link href=\"help:gnome-help/shell-"
"Webovou stránku můžete uložit jako <em>webovou aplikaci</em>. Tím se odkaz "
"na danou stránku přidá do <link href=\"help:gnome-help/shell-"
"introduction#activities\">Přehledu činností</link>. Webové aplikace se "
"otvírají ve zvláštním okně bez adresního řádku a nabídek."
......@@ -482,7 +483,7 @@ msgstr ""
#. (itstool) path: info/desc
#: C/cert.page:18
msgid "Certificate management in <app>Web</app>."
msgstr "Jak spravovat certifikáty v aplikaci <app>WWW</app>."
msgstr "Jak spravovat certifikáty v aplikaci <app>Web</app>."
#. (itstool) path: page/title
#: C/cert.page:21
......@@ -495,7 +496,7 @@ msgid ""
"<app>Web</app> does not have built-in support for certificate management at "
"this time."
msgstr ""
"Aplikace <app>WWW</app> nemá vestavěnou podporu pro správu certifikátů."
"Aplikace <app>Web</app> nemá vestavěnou podporu pro správu certifikátů."
#. (itstool) path: note/p
#: C/cert.page:27
......@@ -536,8 +537,8 @@ msgstr ""
"<em>Cookie</em> je malé množství dat, která si navštívené stránky mohou "
"ukládat na váš počítač. Když se později na takovou stránku vrátíte, data "
"uložená v cookie informují stránku o vašem předchozím počínání na této "
"stránce. Servery WWW běžně používají cookies k zapamatování si vašeho "
"přihlášení ke stránkám WWW nebo webovým službám."
"stránce. Webové servery běžně používají cookies k zapamatování si vašeho "
"přihlášení k webovým stránkám nebo webovým službám."
#. (itstool) path: credit/name
#: C/data-cookies.page:16 C/data-passwords.page:24 C/pref-do-not-track.page:12
......@@ -571,7 +572,7 @@ msgid ""
"\">Preferences</gui><gui style=\"tab\">Privacy</gui><gui style=\"button"
"\">Manage Cookies</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Soukromí</gui><gui style=\"button"
"\">Správa cookies</gui></guiseq>."
......@@ -626,7 +627,7 @@ msgid ""
"style=\"menuitem\">Preferences</gui><gui style=\"tab\">Privacy</gui><gui "
"style=\"button\">Manage Passwords</gui></guiseq>."
msgstr ""
"Uložená hesla můžete vidět v <guiseq><gui style=\"menu\">WWW</gui><gui style="
"Uložená hesla můžete vidět v <guiseq><gui style=\"menu\">Web</gui><gui style="
"\"menuitem\">Předvolby</gui><gui style=\"tab\">Soukromí</gui><gui style="
"\"button\">Správa hesel</gui></guiseq>."
......@@ -647,7 +648,7 @@ msgid ""
"\">Preferences</gui><gui style=\"tab\">Privacy</gui><gui style=\"button"
"\">Manage Passwords</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Soukromí</gui><gui style=\"button"
"\">Správa hesel</gui></guiseq>."
......@@ -700,7 +701,7 @@ msgid ""
"\"><app>Web</app></link>, you have to update it."
msgstr ""
"Pokud jste změnili heslo, které je uloženo v aplikaci <link xref="
"\"introduction\"><app>WWW</app></link>, je nutno je aktualizovat."
"\"introduction\"><app>Web</app></link>, je nutno je aktualizovat."
#. (itstool) path: steps/title
#: C/data-passwords.page:84
......@@ -755,7 +756,7 @@ msgid ""
"Your browsing history, the web pages that you have visited, is automatically "
"saved so that it is quicker for you to return to those pages."
msgstr ""
"Historie vašeho prohlížení – stránky WWW, jež jste navštívili – je "
"Historie vašeho prohlížení, tj. webové stránky, jež jste navštívili, je "
"automaticky ukládána, aby byl přístup k těmto stránkám rychlejší."
#. (itstool) path: page/p
......@@ -797,7 +798,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem\">History</"
"gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Historie</gui></guiseq>."
#. (itstool) path: item/p
......@@ -845,7 +846,7 @@ msgid ""
"You can use handy keyboard shortcuts to navigate around <app>Web</app> "
"faster."
msgstr ""
"Pro rychlejší práci v aplikaci <app>WWW</app> můžete používat ruční "
"Pro rychlejší práci v aplikaci <app>Web</app> můžete používat ruční "
"klávesové zkratky."
#. (itstool) path: td/p
......@@ -951,7 +952,7 @@ msgstr "<keyseq><key>Shift</key><key>Ctrl</key><key>T</key></keyseq>"
#. (itstool) path: td/p
#: C/keyboard-shortcut.page:117
msgid "Quit <app>Web</app>"
msgstr "Ukončit aplikaci <app>WWW</app>"
msgstr "Ukončit aplikaci <app>Web</app>"
#. (itstool) path: td/p
#: C/keyboard-shortcut.page:120
......@@ -1062,7 +1063,7 @@ msgstr "<keyseq><key>Ctrl</key><key>H</key></keyseq>"
#. (itstool) path: page/title
#: C/keyboard-shortcut.page:205 C/pref.page:24
msgid "<app>Web</app> preferences"
msgstr "Předvolby aplikace <app>WWW</app>"
msgstr "Předvolby aplikace <app>Web</app>"
#. (itstool) path: td/p
#: C/keyboard-shortcut.page:208
......@@ -1202,7 +1203,7 @@ msgstr "<keyseq><key>Shift</key><key>Ctrl</key><key>PgDn</key> </keyseq>"
#. (itstool) path: td/p
#: C/keyboard-shortcut.page:319
msgid "View <app>Web</app> in fullscreen"
msgstr "Zobrazit aplikaci <app>WWW</app> přes celou obrazovku"
msgstr "Zobrazit aplikaci <app>Web</app> přes celou obrazovku"
#. (itstool) path: td/p
#: C/keyboard-shortcut.page:322
......@@ -1296,7 +1297,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Preferences</gui><gui style=\"tab\">Privacy</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Soukromí</gui></guiseq>."
#. (itstool) path: item/p
......@@ -1316,7 +1317,7 @@ msgid ""
"preventing websites that you have not visited from leaving cookies."
msgstr ""
"Obvykle byste měli zvolit <gui>Jen ze serverů, které navštěvujete</gui>, "
"neboť vám tato volba umožní přihlášení k většině účtů na WWW, ale současně "
"neboť vám tato volba umožní přihlášení k většině účtů na webu, ale současně "
"brání serverům, které jste nenavštívili, ukládat cookies ve vašem počítači."
#. (itstool) path: page/p
......@@ -1332,9 +1333,9 @@ msgstr ""
"Pokud si zvolíte cookies <gui>Vždy přijímat</gui>, pak budou servery, jež "
"jste nenavštívili, schopny ukládat <em>cookies třetích stran</em>. Cookies "
"třetích stran často používají reklamní společnosti a sociální sítě ke "
"sledování vaší činnosti napříč WWW a k nabízení cíleného obsahu. Ale pozor, "
"některé servery, jako třeba Outlook.com, používají cookies třetích stran ke "
"zjišťování, zda jste přihlášeni."
"sledování vaší činnosti napříč webovými stránkami a k nabízení cíleného "
"obsahu. Ale pozor, některé servery, jako třeba Outlook.com, používají "
"cookies třetích stran ke zjišťování, zda jste přihlášeni."
#. (itstool) path: page/p
#: C/pref-cookies.page:59
......@@ -1355,7 +1356,7 @@ msgstr "Gordon Hill"
#. (itstool) path: info/desc
#: C/pref-css.page:24
msgid "Override the theme which is used to display web pages."
msgstr "Přepište motiv použitý k zobrazení stránek WWW."
msgstr "Přepište motiv použitý k zobrazení webových stránek."
#. (itstool) path: page/title
#: C/pref-css.page:27
......@@ -1379,7 +1380,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Preferences</gui><gui style=\"tab\">Fonts &amp; Style</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Písma a styl</gui></guiseq>."
#. (itstool) path: item/p
......@@ -1456,7 +1457,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Preferences</gui><gui style=\"tab\">General</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Obecné</gui></guiseq>."
#. (itstool) path: item/p
......@@ -1602,7 +1603,7 @@ msgid ""
"asked if you want to remember the login details. You can check if this "
"preference is enabled or change your settings in <gui>Preferences</gui>."
msgstr ""
"Když stránce WWW odešlete přihlašovací jméno a heslo, budete většinou "
"Když webové stránce odešlete přihlašovací jméno a heslo, budete většinou "
"dotázáni, zda chcete, aby si prohlížeč zapamatoval přihlašovací informace. "
"Ověřit či změnit toto nastavení můžete v <gui>Předvolbách</gui>."
......@@ -1612,7 +1613,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui> <gui style=\"menuitem"
"\">Preferences</gui> <gui style=\"tab\">Privacy</gui></guiseq>."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem"
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem"
"\">Předvolby</gui><gui style=\"tab\">Soukromí</gui></guiseq>."
#. (itstool) path: item/p
......@@ -1623,7 +1624,7 @@ msgid ""
"app> remembering passwords."
msgstr ""
"Pole <gui style=\"checkbox\">Pamatovat hesla</gui> bude zaškrtnuté, pokud se "
"hesla mají pamatovat. Aby si aplikace <app>WWW</app> hesla nepamatovala, "
"hesla mají pamatovat. Aby si aplikace <app>Web</app> hesla nepamatovala, "
"zaškrtnutí zrušte."
#. (itstool) path: item/p
......@@ -1647,7 +1648,7 @@ msgid ""
"You can restore the pages you closed as long as at least one <app>Web</app> "
"is still open."
msgstr ""
"Dokud aplikaci <app>WWW</app> úplně nezavřete, máte možnost stránky, které "
"Dokud aplikaci <app>Web</app> úplně nezavřete, máte možnost stránky, které "
"jste zavřeli, zase obnovit."
#. (itstool) path: item/p
......@@ -1656,7 +1657,7 @@ msgid ""
"Open <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem\">Reopen "
"Closed Tab</gui></guiseq>, your last closed tab will be reopened."
msgstr ""
"Otevřete <guiseq><gui style=\"menu\">WWW</gui><gui style=\"menuitem\">Znovu "
"Otevřete <guiseq><gui style=\"menu\">Web</gui><gui style=\"menuitem\">Znovu "
"otevřít zavřenou kartu</gui></guiseq> a vaše poslední zavřená karta bude "
"znovu otevřena."
......@@ -1701,4 +1702,3 @@ msgstr ""
"K procházení webů můžete používat server proxy. Pokud tomu tak chcete, "
"musíte to <link href=\"help:gnome-help/net-proxy\">nastavit v panelu "
"<gui>Síť</gui> v nastavení GNOME</link>."
# Polish translation for epiphany help.
# Copyright © 2017 the epiphany authors.
# This file is distributed under the same license as the epiphany package.
# This file is distributed under the same license as the epiphany help.
# Piotr Drąg <piotrdrag@gmail.com>, 2017.
# Aviary.pl <community-poland@mozilla.org>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: epiphany-help\n"
"POT-Creation-Date: 2017-08-16 09:01+0000\n"
"POT-Creation-Date: 2017-09-29 16:26+0000\n"
"PO-Revision-Date: 2017-08-19 20:01+0200\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <community-poland@mozilla.org>\n"
......
This diff is collapsed.
......@@ -39,9 +39,8 @@
* analyze modules. Refer to doc/debugging.txt for more information.
*/
static const char *ephy_debug_break = NULL;
#if DEVELOPER_MODE
static const char *ephy_debug_break = NULL;
static GHashTable *ephy_profilers_hash = NULL;
static char **ephy_profile_modules;
static gboolean ephy_profile_all_modules;
......
......@@ -25,6 +25,7 @@
#include "ephy-file-helpers.h"
#include "ephy-debug.h"
#include "ephy-flatpak-utils.h"
#include "ephy-prefs.h"
#include "ephy-profile-utils.h"
#include "ephy-settings.h"
......@@ -141,11 +142,12 @@ ephy_file_get_downloads_dir (void)
download_dir = g_settings_get_string (EPHY_SETTINGS_STATE,
EPHY_PREFS_STATE_DOWNLOAD_DIR);
if (g_str_equal (download_dir, "Desktop"))
download_dir = ephy_file_desktop_dir ();
if (g_str_equal (download_dir, "Downloads") ||
g_path_is_absolute (download_dir) != TRUE)
if (!g_strcmp0 (download_dir, "Downloads") ||
!g_path_is_absolute (download_dir) ||
ephy_is_running_inside_flatpak ())
download_dir = ephy_file_download_dir ();
else if (!g_strcmp0 (download_dir, "Desktop"))
download_dir = ephy_file_desktop_dir ();
return download_dir;
}
......@@ -1039,3 +1041,33 @@ ephy_open_incognito_window (const char *uri)
g_free (command);
}
gboolean
ephy_file_launch_via_uri_handler (const char *uri)
{
GdkDisplay *display;
GdkAppLaunchContext *context;
GError *error = NULL;
display = gdk_display_get_default ();
context = gdk_display_get_app_launch_context (display);
g_app_info_launch_default_for_uri (uri, G_APP_LAUNCH_CONTEXT (context), &error);
if (error != NULL) {
g_warning ("Failed to launch handler for URI %s: %s", uri, error->message);
g_error_free (error);
return FALSE;
}
return TRUE;
}
gboolean
ephy_file_launch_file_via_uri_handler (GFile *file)
{
const char *uri;
uri = g_file_get_uri (file);
return ephy_file_launch_via_uri_handler (uri);
}
......@@ -94,6 +94,8 @@ char * ephy_sanitize_filename (char
GAppInfo * ephy_file_launcher_get_app_info_for_file (GFile *file,
const char *mime_type);
void ephy_open_default_instance_window (void);
void ephy_open_incognito_window (const char *uri);
void ephy_open_incognito_window (const char *uri);
gboolean ephy_file_launch_via_uri_handler (const char *uri);
gboolean ephy_file_launch_file_via_uri_handler (GFile *file);
G_END_DECLS
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Copyright © 2017 Igalia S.L.
*
* This file is part of Epiphany.
*
* Epiphany is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Epiphany is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Epiphany. If not, see <http://www.gnu.org/licenses/>.
*/
/* For O_PATH */
#define _GNU_SOURCE
#include <config.h>
#include "ephy-flatpak-utils.h"
#ifdef __linux__
#include <errno.h>
#include <fcntl.h>
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
gboolean
ephy_is_running_inside_flatpak (void)
{
return g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS);
}
static void
response_cb (GDBusConnection *connection,
const char *sender_name,
const char *object_path,
const char *interface_name,
const char *signal_name,
GVariant *parameters,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
guint32 response;
guint signal_id;
signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "signal-id"));
g_dbus_connection_signal_unsubscribe (connection, signal_id);
g_task_return_error_if_cancelled (task);
g_variant_get (parameters, "(u@a{sv})", &response, NULL);
if (response == 0)
g_task_return_boolean (task, TRUE);
else if (response == 1)
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation cancelled");
else /* yes, this is abuse of G_IO_ERROR, but I don't want to make a new error quark */
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Portal failed to open file");
}
static void
open_file_complete_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source);
GTask *task = G_TASK (user_data);
GVariant *return_value = NULL;
const char *handle;
char *object_path = NULL;
GError *error = NULL;
return_value = g_dbus_proxy_call_with_unix_fd_list_finish (proxy, NULL, result, &error);
if (!return_value) {
g_warning ("Failed to open file via portal: %s", error->message);
g_task_return_error (task, error);
goto out;
}
/* Copied from Gio source code. To understand the signal resubscription
* dance, refer to the org.freedesktop.portal.Request documentation. */
g_variant_get (return_value, "(o)", &object_path);
handle = (const char *)g_object_get_data (G_OBJECT (task), "handle");
if (strcmp (handle, object_path) != 0) {
GDBusConnection *connection;
guint signal_id;
connection = g_dbus_proxy_get_connection (proxy);
signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "signal-id"));
g_dbus_connection_signal_unsubscribe (connection, signal_id);
signal_id = g_dbus_connection_signal_subscribe (connection,
"org.freedesktop.portal.Desktop",
"org.freedesktop.portal.Request",
"Response",
handle,
NULL,
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
response_cb,
task,
NULL);
g_object_set_data (G_OBJECT (task), "signal-id", GUINT_TO_POINTER (signal_id));
}
out:
if (return_value)
g_variant_unref (return_value);
if (object_path)
g_free (object_path);
}
static void
portal_proxy_created_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
GTask *task;
GDBusProxy *proxy;
GVariantBuilder builder;
GDBusConnection *connection;
GUnixFDList *fd_list;
int fd;
guint signal_id;
char *sender;
char *token;
char *handle;
GError *error = NULL;
task = G_TASK (user_data);
fd = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (task), "fd"));
proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
if (!proxy) {
g_warning ("Failed to create D-Bus proxy for OpenURI portal: %s", error->message);
g_task_return_error (task, error);
close (fd);
return;
}
g_object_set_data_full (G_OBJECT (task), "proxy", proxy, g_object_unref);
/* Refer to org.freedesktop.portal.Request documentation. */
connection = g_dbus_proxy_get_connection (proxy);
sender = g_strdup (g_dbus_connection_get_unique_name (connection) + 1);
for (guint i = 0; sender[i] != '\0'; i++)
if (sender[i] == '.')
sender[i] = '_';
token = g_strdup_printf ("epiphany%u", g_random_int ());
handle = g_strdup_printf ("/org/freedesktop/portal/desktop/request/%s/%s", sender, token);
g_object_set_data_full (G_OBJECT (task), "handle", handle, g_free);
g_free (sender);
signal_id = g_dbus_connection_signal_subscribe (connection,
"org.freedesktop.portal.Desktop",
"org.freedesktop.portal.Request",
"Response",
handle,
NULL,
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
response_cb,
task,
NULL);
g_object_set_data (G_OBJECT (task), "signal-id", GUINT_TO_POINTER (signal_id));
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (&builder, "{sv}", "handle_token", g_variant_new_string (token));
g_free (token);
fd_list = g_unix_fd_list_new_from_array (&fd, 1);
g_dbus_proxy_call_with_unix_fd_list (proxy,
"OpenFile",
g_variant_new ("(s@h@a{sv})",
"",
g_variant_new("h", 0),
g_variant_builder_end (&builder)),
G_DBUS_CALL_FLAGS_NONE,
-1,
fd_list,
NULL,
open_file_complete_cb,
task);
g_object_unref (fd_list);
}
void
ephy_open_file_via_flatpak_portal (const char *path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GTask *task;
int fd;
fd = open (path, O_PATH | O_CLOEXEC);
if (fd == -1) {
g_warning ("Failed to open %s: %s", path, g_strerror (errno));
return;
}
task = g_task_new (NULL, cancellable, callback, user_data);
g_object_set_data (G_OBJECT (task), "fd", GINT_TO_POINTER (fd));
/* We have to do this manually. The recommended solution is to use
* g_app_info_launch_default_for_uri(), but that will fail if trying
* to open anything that Epiphany itself can open... like text files.
* The file will be opened in Epiphany, but we want to get an app
* chooser. Otherwise, trying to view page source is just going to open
* another browser tab displaying the page in question. Ugh. */
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
NULL,
"org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
"org.freedesktop.portal.OpenURI",
NULL,
portal_proxy_created_cb,
task);
}
gboolean
ephy_open_file_via_flatpak_portal_finish (GAsyncResult *result,
GError **error)
{
gboolean ret;
ret = g_task_propagate_boolean (G_TASK (result), error);
g_object_unref (result);
return ret;
}
#else /* __linux__ */
gboolean
ephy_is_running_inside_flatpak (void)
{
return FALSE;
}
void
ephy_open_file_via_flatpak_portal (const char *path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_assert_not_reached ();
}
gboolean
ephy_open_file_via_flatpak_portal_finish (GAsyncResult *result,