Dmitry Bogatov [Sun, 29 May 2016 09:56:51 +0000 (11:56 +0200)]
Check $HOME and home dir of $USER before getpwuid()->pw_dir
getpwnam(3) recommends to use $HOME instead of getpwuid()->pw_dir,
as it allows users to point programs to a different path.
Using getpwuid() also breaks namespaces-related use cases,
like `unshare -r`.
Patch was submitted by Dmitry Bogatov on the Debian bug tracker:
https://bugs.debian.org/825397
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Sat, 16 Apr 2016 04:19:13 +0000 (06:19 +0200)]
Fix url parsing in load()
Quentin Rameau [Thu, 3 Mar 2016 15:51:24 +0000 (16:51 +0100)]
Apply domain parameters each time url is changed
Urls are only changed at load (initial requested one), or while
redirected. When the page is committed, url is already final.
Quentin Rameau [Sat, 9 Jan 2016 12:42:50 +0000 (13:42 +0100)]
Fix inspector toggling
Always get the inspector object, and let the user eventually close it
even if it's disabled for the current page.
Quentin Rameau [Sat, 9 Jan 2016 11:57:39 +0000 (12:57 +0100)]
Rectify how parameters are handled in setparameter()
Access parameters through given Arg parameter instead of accessing
global parameters.
Quentin Rameau [Sun, 29 Nov 2015 23:39:52 +0000 (00:39 +0100)]
Fix parameter initialization and assignment
Quentin Rameau [Sun, 29 Nov 2015 16:42:42 +0000 (17:42 +0100)]
Adapting the whole surf structure to new settings
Quentin Rameau [Sun, 29 Nov 2015 16:22:15 +0000 (17:22 +0100)]
Adapt default parameters to new config style
Quentin Rameau [Sun, 29 Nov 2015 16:16:48 +0000 (17:16 +0100)]
Introduce new data structure for handling settings
Dmitrij D. Czarkoff [Sun, 6 Mar 2016 00:14:52 +0000 (01:14 +0100)]
Disable globbing in curl command
Curl is invoked for downloading particular files. Without "-g" flag it would
apply globbing rules to URLs, which may end badly in case URL is not properly
quoted.
Quentin Rameau [Wed, 2 Mar 2016 13:29:21 +0000 (14:29 +0100)]
Get rid of JavaScript for scrolling in views
This is still a hack, until WebKitGTK gives us a more practical and
stable way to do that. Manipulating directly the DOM inside a
webextension is a pain and only usable with unstable API atm.
Quentin Rameau [Sun, 29 Nov 2015 23:45:18 +0000 (00:45 +0100)]
Modify linking parameter
Christoph Lohmann [Mon, 22 Feb 2016 05:47:46 +0000 (06:47 +0100)]
Import the arg.h from st which fixed the oob bug.
Quentin Rameau [Tue, 1 Dec 2015 11:31:42 +0000 (12:31 +0100)]
Fix title handling
Don't forget to always set the title to the current uri, this way it's
up to date when there is no title on the page (ie for local file
exploration).
Thanks to pickfire for reporting the issue.
Quentin Rameau [Tue, 24 Nov 2015 22:18:06 +0000 (23:18 +0100)]
Fix clickexternplayer(), no need to test the target again
Quentin Rameau [Mon, 23 Nov 2015 21:13:32 +0000 (22:13 +0100)]
Fix user agent command-line parameter
Thanks to yui for seeing that!
Quentin Rameau [Sun, 22 Nov 2015 18:13:48 +0000 (19:13 +0100)]
Add webkit language settings
You can now set your prefered website languages in order.
It is also possible to enable spell checking in the same way.
Quentin Rameau [Sun, 22 Nov 2015 16:44:40 +0000 (17:44 +0100)]
Fix key handling
I had forgotten to compare configured key values against lowered pressed
key values.
Integrated keypress() into winevent().
Quentin Rameau [Sun, 22 Nov 2015 15:45:22 +0000 (16:45 +0100)]
Fix target uri handling when leaving window
Introduce a new string pointer overtitle in Client to be able to keep
the targeturi intact while modifying the former for overriding or not
the window title.
Connect to GDK_ENTER_NOTIFY to restore overtitle when refocusing on
window.
Quentin Rameau [Sun, 22 Nov 2015 14:31:15 +0000 (15:31 +0100)]
Adapt togglestyle()
We can't apply an empty stylesheet anymore, instead remove any previous
stylesheet.
Quentin Rameau [Sun, 22 Nov 2015 14:19:10 +0000 (15:19 +0100)]
Modify decideresource() and favicon handling
Return as soon as the request has been processed.
No need to modify the favicon uri, just ignore it.
Quentin Rameau [Sun, 22 Nov 2015 12:51:05 +0000 (13:51 +0100)]
Style change in newview(), sort signals order
Quentin Rameau [Sun, 22 Nov 2015 12:44:31 +0000 (13:44 +0100)]
Fix error handling in spawn()
Be more specific about process name and exit with an error.
Quentin Rameau [Sun, 22 Nov 2015 12:33:28 +0000 (13:33 +0100)]
Modify default handling of cookiepolicy functions
It's more obvious this way that the default is to always accept cookies
and not the other way around.
Quentin Rameau [Sun, 22 Nov 2015 12:24:24 +0000 (13:24 +0100)]
Simplify handling of c->title
Quentin Rameau [Sun, 22 Nov 2015 12:15:39 +0000 (13:15 +0100)]
Fix pasteuri()
The uri check had been inverted.
Quentin Rameau [Sun, 22 Nov 2015 11:22:23 +0000 (12:22 +0100)]
Style fix in sigchld()
Quentin Rameau [Sun, 22 Nov 2015 11:17:05 +0000 (12:17 +0100)]
Replace use of EXIT_* constants to 0 and 1
Quentin Rameau [Sun, 22 Nov 2015 10:53:19 +0000 (11:53 +0100)]
Fix WM_CLASS and WM_WINDOW_ROLE properties
Instead of forcing class and instance names, which is what GTK does by
default anyway, allow the user to set the instance name, but keep the
general class as “Surf”.
Is we won't support a “-name” parameter and don't implement a parsing of
RESOURCE_NAME env variable, let's fallback on the third behaviour, use
the name of the calling executable.
That would let the user do things like 'ln -s ./surf ./surf-other;
./surf-other' and set different parameters for the two instances (in dwm
for example).
Try to generate a unique WM_WINDOW_ROLE (within the surf process)
composed of “Surf” and the view ID.
Quentin Rameau [Sun, 22 Nov 2015 02:00:03 +0000 (03:00 +0100)]
Remove window hints settings
Setting minimum size to 1x1 is not necessary as this is the default.
Quentin Rameau [Sun, 22 Nov 2015 01:25:07 +0000 (02:25 +0100)]
Style indentation fix
Quentin Rameau [Sun, 22 Nov 2015 01:22:38 +0000 (02:22 +0100)]
Continue making chars const
Quentin Rameau [Sun, 22 Nov 2015 01:10:18 +0000 (02:10 +0100)]
Correct and simplify buttonreleased() gdk event
The passed event is a GdkEvent (or GdkEventButton), but not a
GdkEventKey.
Access the struct directly.
Quentin Rameau [Sun, 22 Nov 2015 01:03:26 +0000 (02:03 +0100)]
Un(g)boolify to separate GTK dependant code from the rest
Quentin Rameau [Sun, 22 Nov 2015 00:52:13 +0000 (01:52 +0100)]
Use char instead of gchar and make them const when possible
Quentin Rameau [Sun, 22 Nov 2015 00:42:34 +0000 (01:42 +0100)]
Style update for indentation
Quentin Rameau [Sat, 21 Nov 2015 18:53:29 +0000 (19:53 +0100)]
Add mouse function to play medias in external player
Control + left click launches mpv with the target media url.
Quentin Rameau [Sat, 21 Nov 2015 18:24:19 +0000 (19:24 +0100)]
Update credits
Quentin Rameau [Sat, 21 Nov 2015 18:22:11 +0000 (19:22 +0100)]
Style change in includes order
Quentin Rameau [Sat, 21 Nov 2015 18:14:08 +0000 (19:14 +0100)]
Style change in functions ordering
Try to group and order functions in a logical manner.
Same thing for config keybindings.
Quentin Rameau [Fri, 20 Nov 2015 16:42:25 +0000 (17:42 +0100)]
Cleanup remaining unused variables and copystr()
Quentin Rameau [Fri, 20 Nov 2015 16:39:45 +0000 (17:39 +0100)]
Adapt newwindow()
Reorder cmdline options alphabetically and try to keep settings as they
have been toggled in this surf client.
Quentin Rameau [Fri, 20 Nov 2015 16:12:00 +0000 (17:12 +0100)]
Adapt user agent handling
Now we can only append Surf version to the default WebKit user agent
instead of setting the whole string (while this remains possible to do).
Quentin Rameau [Fri, 20 Nov 2015 15:59:15 +0000 (16:59 +0100)]
Adapt updatetitle()
Now always show loading progress, still print mouse over link uri before
page uri. Process simplyfied because we use const strings.
Quentin Rameau [Fri, 20 Nov 2015 15:53:52 +0000 (16:53 +0100)]
Adapt toggle statistics
Rename *togglestat to plural *togglestats, add frame flatenning
indicator, resize array in consequence.
Use a static index instead of a dynamic one as we always use all values
anyway.
Quentin Rameau [Fri, 20 Nov 2015 15:48:18 +0000 (16:48 +0100)]
Adapt page statistics
Rename *pagestat to plural *pagestats, and resize array to reflect
missing proxy parameter.
Quentin Rameau [Fri, 20 Nov 2015 15:39:53 +0000 (16:39 +0100)]
Adapt loaduri()
Better handling of different URIs. Filter out “about:” scheme, dont
touch URI if it contains a complete scheme (we assume "://", denotes
one), else test if given path is an actual reachable file on the
filesystem, else prepend arbitrary http:// scheme.
Quentin Rameau [Fri, 20 Nov 2015 15:35:13 +0000 (16:35 +0100)]
Adapt config MACROs SETPROP, DOWNLOAD, PLUMB
As we now use directly const strings from WebKitGTK, “constify” arg void
pointer.
Quentin Rameau [Fri, 20 Nov 2015 15:19:24 +0000 (16:19 +0100)]
Rename mouse functions to clickFUNCTION()
Quentin Rameau [Fri, 20 Nov 2015 14:48:04 +0000 (15:48 +0100)]
Adapt toggle(), clean some config parameters
Regroup all toggles in an enum and handle them with a unique function
via a switch. That lets us take different actions for each toggle.
Add a frame flatenning and a dns preteching options.
Quentin Rameau [Fri, 20 Nov 2015 00:12:28 +0000 (01:12 +0100)]
Adapt find()
Slightly new behaviour: searching again for the same string (via MOD+/)
resets the search (ie restarts search from document top).
Searching for an empty string stops the search (ie all highlights are
removed).
Quentin Rameau [Fri, 20 Nov 2015 00:03:32 +0000 (01:03 +0100)]
Adapt zoom()
Quentin Rameau [Fri, 20 Nov 2015 00:00:38 +0000 (01:00 +0100)]
Adapt navigate()
Quentin Rameau [Thu, 19 Nov 2015 23:58:14 +0000 (00:58 +0100)]
Remove togglescrollbars()
We do not have access to scrollbars and will have to manipulate DOM to
do that.
Quentin Rameau [Thu, 19 Nov 2015 23:53:14 +0000 (00:53 +0100)]
Adapt scrolling
In fact, we have a scrolling handle ersatz for now using JavaScript
calls as we don't have access anymore to scrollbars.
We'll have to manipulate the DOM directly (later).
Quentin Rameau [Thu, 19 Nov 2015 23:44:29 +0000 (00:44 +0100)]
Adapt inspector handling
The inspector is now easily manageable via API, there's no need for
keeping its state in the Client.
Quentin Rameau [Thu, 19 Nov 2015 23:30:17 +0000 (00:30 +0100)]
Adapt print()
Quentin Rameau [Thu, 19 Nov 2015 23:17:50 +0000 (00:17 +0100)]
Simplify building of stylefiles path
We can directly use style file pointers instead of using temporary
string pointers.
Quentin Rameau [Thu, 19 Nov 2015 23:13:07 +0000 (00:13 +0100)]
Adapt setstyle()
We can't anymore pass a simple path to a stylefile, we have to read the
entire file to create a stylesheet and apply it to the view.
Quentin Rameau [Thu, 19 Nov 2015 23:09:21 +0000 (00:09 +0100)]
Adapt clipboard()
Replace linkhover with target uri and add some comments
Quentin Rameau [Thu, 19 Nov 2015 23:00:59 +0000 (00:00 +0100)]
Rename fullscreen() to togglefullscreen()
And handle c->fullscreen value in winevent(). This way we keep track of
fullscreen state even if we did not directly initiate the fullscreen.
Quentin Rameau [Thu, 19 Nov 2015 22:42:19 +0000 (23:42 +0100)]
Replace titlechangeleave() with catch-all winevent()
All GtkWidget events have the same function prototype with the generic
GdkEvent as parameter. This will let us handle everything in the switch.
Quentin Rameau [Thu, 19 Nov 2015 16:14:29 +0000 (17:14 +0100)]
Adapt JavaScript functions
Removed eval(), evalscript() is now sufficient and can directly execute
passed JavaScript string.
Quentin Rameau [Thu, 19 Nov 2015 15:38:58 +0000 (16:38 +0100)]
Remove windowobjectcleared(), execute scripts on load finished
The “window-object-cleared” signal is not directly accessible for
specific WebViews now. We'll have to use an Extension or rewrite the
JavaScript running functions.
Quentin Rameau [Thu, 19 Nov 2015 13:38:23 +0000 (14:38 +0100)]
Add createwindow() for GtkWindow creation
Move there window creation from showview().
Quentin Rameau [Thu, 19 Nov 2015 13:25:29 +0000 (14:25 +0100)]
Add closeview() for JavaScript window closing
Simply call gtk_widget_destroy() on the window. Then GtkWindow closing
process will take care of the rest.
Quentin Rameau [Thu, 19 Nov 2015 13:15:28 +0000 (14:15 +0100)]
Remove (delete :>) deletion_interface()
Quentin Rameau [Thu, 19 Nov 2015 13:10:28 +0000 (14:10 +0100)]
Integrate beforerequest() into decidepolicy()
Quentin Rameau [Thu, 19 Nov 2015 12:40:35 +0000 (13:40 +0100)]
Remove contextmenu() and menuactivate() for "context-menu" signal
Those were added because “right click menu to copy the link URI will now
work” (would not work) in 2013. It's been a while since that works without
intervention.
Quentin Rameau [Thu, 19 Nov 2015 12:19:27 +0000 (13:19 +0100)]
Adapted buttonrelease()
Use the current hit test (c->mousepos) to determine where the mouse
pointer is.
It is possible to link an action to a click and still propagate the
event after that by setting the “stop event” parameter of a Button to 0.
Quentin Rameau [Wed, 18 Nov 2015 18:05:59 +0000 (19:05 +0100)]
Replace initdownload() and intercept global download requests.
Attach to download requests on WebKitContext, this way we can easily
manage all types of downloads (coming from views or not).
Quentin Rameau [Wed, 18 Nov 2015 17:51:55 +0000 (18:51 +0100)]
Adapted progresschanged()
Quentin Rameau [Wed, 18 Nov 2015 17:44:25 +0000 (18:44 +0100)]
Manage ssl errors with GTlsCertificateFlags
Keep a GTlsCertificateFlags in Client for TLS errors.
If we don't use a ssl connection, set it to a value greater than maximum
error flag value (which is G_TLS_CERTIFICATE_VALIDATE_ALL for all
possible errors).
Quentin Rameau [Wed, 18 Nov 2015 17:39:45 +0000 (18:39 +0100)]
Replace loadstatuschanged() with loadchanged()
Quentin Rameau [Wed, 18 Nov 2015 17:30:28 +0000 (18:30 +0100)]
Replace decidewindow() and decidedownload() with decidepolicy()
Now all the requests are triggered by one signal.
We then handle each type, resource download, navigation, newwindow, in
separate functions.
Quentin Rameau [Wed, 18 Nov 2015 17:16:06 +0000 (18:16 +0100)]
Replace createwindow() with createview()
We can now perform some filtering before opening a new view (window)
when requested by JavaScript (either random or by a click).
Quentin Rameau [Wed, 18 Nov 2015 17:09:55 +0000 (18:09 +0100)]
Replace geopolicyrequested() with permissionrequested()
The permission-request signal can now ask for than a geolocation
authorisation (though we only handle that for now).
Quentin Rameau [Wed, 18 Nov 2015 16:59:50 +0000 (17:59 +0100)]
Replace linkhover() with mousetargetchanged()
The “linkhover” can now be more than a simple link (image, video, etc.).
As we can't anymore perform a hit test when we want, we have to keep the
last known hit test to be able to know where the mouse is on the next
click event.
Quentin Rameau [Wed, 18 Nov 2015 16:53:33 +0000 (17:53 +0100)]
Modify the context name of the hit tests
These relate more to the position of the pointer when an event occurs.
Quentin Rameau [Wed, 18 Nov 2015 16:42:51 +0000 (17:42 +0100)]
Adapted titlechange()
Do not copy title strings, just carry over the const pointer.
Quentin Rameau [Wed, 18 Nov 2015 16:17:49 +0000 (17:17 +0100)]
Move all necessary initialisation to newview()
Most all the settings and callbacks are set before view creation.
Create a related view (with inherited settings) if asked to.
Quentin Rameau [Wed, 18 Nov 2015 15:53:37 +0000 (16:53 +0100)]
Add newview() and forward related views
View creation is now done in a separate function.
That helps identifying the workflow and let us easily carry related
view (client) when asked by the WebKit for a new one.
Quentin Rameau [Wed, 18 Nov 2015 15:13:27 +0000 (16:13 +0100)]
Add showview()
Only show the window when and if the view is ready.
Move all the window rendering there.
Quentin Rameau [Wed, 18 Nov 2015 15:08:55 +0000 (16:08 +0100)]
Separate the rendering engine process
Use one WebKitWebProcess per view instead of one for all views.
More information in the API documentation.
Quentin Rameau [Wed, 18 Nov 2015 14:29:04 +0000 (15:29 +0100)]
No option to enforce 96DPI anymore on WebKit2
Quentin Rameau [Wed, 18 Nov 2015 14:23:42 +0000 (15:23 +0100)]
Scrolling is now handled through WebKit
We don't have access anymore to the scrolling process and have to rely
entirely on WebKit.
We could be able to manage scrolling and bars directly by manipulating
the DOM via a WebKitExtension. To be continued…
Quentin Rameau [Wed, 18 Nov 2015 14:14:28 +0000 (15:14 +0100)]
SSL policy is now handled through WebKit
Quentin Rameau [Wed, 18 Nov 2015 14:10:42 +0000 (15:10 +0100)]
Disk cache is now handled through WebKit
Quentin Rameau [Wed, 18 Nov 2015 13:48:49 +0000 (14:48 +0100)]
Cookies are now handled through WebKit
Remove all soup cookie handling and use provided interface.
Quentin Rameau [Wed, 18 Nov 2015 13:31:14 +0000 (14:31 +0100)]
Remove source(), it has been removed from webkit2gtk
WebKit2GTK doesn't provide a direct way to view source anymore, we'll
have to do that ourselves with a GtkSourceView if we still need that.
Quentin Rameau [Wed, 18 Nov 2015 13:27:58 +0000 (14:27 +0100)]
Remove proxy stuff, it's now handled by WebView
Quentin Rameau [Wed, 18 Nov 2015 13:43:04 +0000 (14:43 +0100)]
Switch headers to webkit2
Quentin Rameau [Mon, 11 May 2015 10:48:40 +0000 (12:48 +0200)]
Port surf to gtk3
Quentin Rameau [Wed, 4 Nov 2015 14:42:42 +0000 (15:42 +0100)]
buildfile: don't forget to free temporary string bpath
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Tue, 3 Nov 2015 15:50:21 +0000 (16:50 +0100)]
Be more specific about what enablestyles parameter does.
The enablestyles configuration variable and parameter flag manages the
global application of styles, not just the site-specific styles.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Tue, 3 Nov 2015 14:42:30 +0000 (15:42 +0100)]
Fix inspector handling when inspector is disabled.
Do not try to show the inspector window when the inspector is disabled.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Tue, 3 Nov 2015 14:39:29 +0000 (15:39 +0100)]
Fix usage(), -m and -M for styles were absent.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Tue, 3 Nov 2015 13:25:44 +0000 (14:25 +0100)]
Fix fullscreen handling
Handle the fullscreen in a more consistent way with other options:
-f disables fullscreen while -F enables fullscreen.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Sat, 31 Oct 2015 11:34:57 +0000 (12:34 +0100)]
Add setstyle()
Regroup style uri setting application calls under one function.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Quentin Rameau [Sat, 31 Oct 2015 11:34:31 +0000 (12:34 +0100)]
Fix style files handling: stop leaking strings.
Everytime getstyle() was being called, we returned newly allocated
strings without ever freing them.
Now uri stylefiles only get allocated once at setup().
Signed-off-by: Christoph Lohmann <20h@r-36.net>