summaryrefslogtreecommitdiff
path: root/src/util.c
AgeCommit message (Collapse)Author
2023-01-03global: Convert use of `SoupURI` to use `GUri`Patrick Steinhardt
The `SoupURI` interface has been deprecated in libsoup 3.0 in favor of `GUri`, which is part of glib 2.66 and newer. Convert the codebase to use the latter.
2023-01-03util.c: Convert deprecated use of JSValueRefPatrick Steinhardt
The JSValueRef interface has been deprecated in WebKit 2.22.0. Convert the code to use the modern `JSCValue` interface instead.
2021-09-25Project branch offrafa_99
2021-01-07Fix none registered webextension in ephemeral mode.Daniel Carl
Fixes #652
2020-10-13Move some file to $XDG_DATA_HOME #582.Daniel Carl
Do not store all files in XDG_CONFIG_HOME.
2020-01-04Remove expansion of '%' #584.Daniel Carl
The % is often used in urls and in case of the x-hint-command those are feed to :shellcmd and will be replaced by current URL. This made the x-hint-command unusable on some search engines. The expansion of % to the current URL also required to give the current browser state to the expansion logic and to feed it to all callers of this too. This bloated the code. This patch removes the % expansion which was a redundant alternative to $VIMB_URI.
2019-10-09Added :clearcache by :cleardata command.Daniel Carl
Allow to clear different types of website data base on the last update time.
2019-06-04Added ephemeral mode #562.Daniel Carl
If vimb is started with --ephemeral option no files are created by default and no persistent cookie manager is used.
2019-05-20Avoid double free in on_webview_notify_uri #561.Daniel Carl
Thank to Valérian Rousset for pointing this out. Also change the until_sanitize_uri function to return given uri in case an error occurred during sanitization process to reduce cases where this function returns NULL.
2019-05-20Fix NULL ret of util_sanitize_uritharvik
2019-04-24Fix segfault on open in new tabe from context menu #556.Daniel Carl
2019-03-25Use webkit_uri_for_display().Daniel Carl
Use this function for shown url for IDN homograph mitigation.
2018-10-25Fix some code indentation.Daniel Carl
2018-10-25Avoid possible strlen() on NULL contentLeonardo Taccari
2018-10-15Fixed wrong return type for util_file_set_content().Daniel Carl
2018-10-15Document a subtlety of util_parse_expansion() behaviour.Leonardo Taccari
Single ~ uses g_get_home_dir() that honor HOME environment variable. However, ~user always consult the passwd file.
2018-10-12Always use curly braces for if and else.Daniel Carl
2018-10-12Use stat(2) to retrieve the file permissions modeLeonardo Taccari
Remove the mode arguments from util_file_prepend_line(), util_file_pop_line() and util_file_set_content(). Both util_file_prepend_line() and util_file_pop_line() just calls util_file_set_content() so stat(2) can be used there and if it fails the 0600 is used as a fallback. Thanks to @fanglingsu for reviews and suggestions!
2018-10-11Replace g_file_set_contents().Daniel Carl
The g_file_set_contents performs atomic write to file by creating a temporary file, writing to it and renaming it. But during the creation of the temporary file, the mode is set hard to 0666. So our files will silently always change their mode in case we processed their content. This patch adds the util_file_set_content() function which follows the same approach, but allows to set the mode that is used to create the temporary file. So the file is created with the right permissions.
2018-10-10Add a mode (in chmod(2) context) argument to util_get_filepath()Leonardo Taccari
Add a mode argument to util_get_filepath() in order to adjust file permissions when creating file. Adjust all util_get_filepath() call and file permissions making them readable and writable only by the user.
2018-06-14Do not damage utf8 string on escape.Daniel Carl
This fixes #492.
2018-04-14Do not give client to util functions.Daniel Carl
Give only those information the util functions need to work.
2018-03-28Update license year.Daniel Carl
2017-11-17Do not sanitize uri if this is no needed.Daniel Carl
Most of the time uri do not contain credentials, so don't run expensive uri cleanup if there is not @ char in uri indicating that this might contain at least a username and possibly also and password.
2017-11-15Move sanitize_uri to utils.Daniel Carl
This will allow us to used this in other parts too.
2017-10-01Reintroduce autocmd and augroups. Fix #356Yoann Blein
2017-06-24Use Uppercase bool value from glib.Daniel Carl
2017-06-06Fixed unused function parameter.Daniel Carl
2017-05-26Update license year.Daniel Carl
2017-05-12Fixed wrong client to webpage relation #349.Daniel Carl
In case a related webview is created. The relation between webextensions web page and the client in the ui process where mismatched. In fact the relation was correct, but when a dbus call was fired from ui to webextension, the webextension used the last created web page to run javascript in or to focus input fields. This patch adds the page_id of the web page to the dbus calls that target a specific web page. So that th webextension can get the right page by this id to use to answer the call. Also the communication from webextension to ui lagged this essential information. So that a click to a editable filed in a related webview all related instances into input mode switched.
2017-05-12implements external editor (closes #347)Robert Timm
2017-05-04fixes typosRobert Timm
2017-04-27Moved closed file writing to util #379.Daniel Carl
2017-04-26Fixed wrongs check of g_mkdir_with_parents #381.Daniel Carl
2017-04-22Add profile option #343.Daniel Carl
2017-04-21Don't fail on missing files.Daniel Carl
2017-04-20Show if directory can't be created.Daniel Carl
2017-04-20Added :save command.Daniel Carl
2017-04-12Use script message handler to track elements focus changes.Daniel Carl
Use script message handler instead of dbus to track for focused editable elements to switch vimb into input mode or back to normal mode.
2017-02-28Allow to manage bookmarks and queue.Daniel Carl
2016-06-01Update license year.Daniel Carl
2016-03-30Startup webkit2 branch from the scratch.Daniel Carl
2015-11-27Added closed-max-items optionYutao Yuan
2015-10-21Use flock instead of fcntl for file locking (#235).Daniel Carl
2015-09-21Add :source commandYutao Yuan
2015-07-29Support for multiple configuration profiles (#129)Jiri Marsicek
New parameter is introduced to allow multiple configuration profiles per user. If vimb is started with this parameter new configuration directory is created under default configuration directory. Cache and socket file are kept separate per profile as well. If vimb is started without this parameter, behaviour is unchanged. Resolves fanglingsu/vimb#129
2015-02-07Changed wrong comment.Daniel Carl
2015-02-07Allocate new memory for history items.Daniel Carl
This makes it easier to maintain the code and to avoid memory leaks.
2015-02-07Fixed memory leak in history generation (#163).Daniel Carl
The changes in the way the memory is allocated, cause a memory leak because all those history items that where read from file but where not put into the list, could not be freed by the caller.
2015-02-07Use hash table for duplicate check of history (#163).Daniel Carl
The previous duplication check where don on the generated list of history items with callback function which is really slow for large history files. Now the histories url is put into a hash table for a faster duplicate check. Additional to this some unneeded memory allocation where removed. This makes the code a little harder to maintain, but hey we don't want to wast time and memory here.