48 Commits

Author SHA1 Message Date
Christoph Lohmann 606c6e3297 Making dist work again. 2013-02-10 19:40:14 +01:00
Christoph Lohmann 076d9f2350 Bumping up to 0.6. 2013-02-10 19:33:54 +01:00
Christoph Lohmann 43840c8528 The javascriptcore is now in webkit. 2013-02-09 04:33:58 +01:00
Christoph Lohmann d6a3e28be2 Fixing cookie handling for https/http by using curl. 2013-02-02 15:42:09 +01:00
Christoph Lohmann 77036565da Removing the deprecated g_thread_init call. 2013-02-02 09:40:34 +01:00
Christoph Lohmann 8c15f0e758 Fixing the style and making the inspector work again. 2013-01-26 21:01:23 +01:00
Christoph Lohmann 0415175e10 Making more than one Modkey to work in keys. 2013-01-26 16:00:52 +01:00
Christoph Lohmann e784d925df Adding web inspector support to surf.
Thanks Gregor Best <gbe@ring0.de>!
2013-01-26 15:53:33 +01:00
Christoph Lohmann 13b04d8b61 Style inquisition plus blocking of the */favicon.ico request. Thanks Peter A.
Shevtsov!
2012-12-06 13:32:52 +01:00
Christoph Lohmann a013f0857e Changing the default DOWNLOAD to use st. 2012-12-04 21:48:42 +01:00
Christoph Lohmann 6ddc8a80fd Add a nice todo item for videos. Thanks morphles. 2012-12-04 07:47:54 +01:00
Christoph Lohmann 3dd006f1c1 Adding a man section about how to handle plugins. 2012-12-04 07:26:12 +01:00
Christoph Lohmann 96e3ae41dd Adding the fullscreen mode to the manpage. 2012-12-03 21:27:39 +01:00
Christoph Lohmann 0dfdb75804 Implementing fullscreen mode. Thanks Krol, Willem van de! 2012-12-03 21:19:16 +01:00
Christoph Lohmann 1f30ddf224 Adding me to the LICENSE file. 2012-12-03 11:25:31 +01:00
Christoph Lohmann 760f8f36de Resolving some conflicts in the shortcuts. 2012-12-02 22:48:41 +01:00
Christoph Lohmann e96f191088 Making zoom available when used in tabbed. 2012-12-02 22:41:18 +01:00
Christoph Lohmann 6cd54e4a31 Surf now can handle absolute file paths. This allows better local HTML
reading.
2012-11-25 22:31:46 +01:00
Christoph Lohmann ad794e0f00 The control of the toggles is now Ctrl-Shift-$character. That's easier for new
users.
2012-11-20 16:14:28 +01:00
Christoph Lohmann 5501d75d2c Fix some styling in the config.def.h, fix the DOWNLOAD macro and unify the
variable naming a bit.
2012-11-20 16:02:57 +01:00
Christoph Lohmann a7ea753f93 Add a referer argument to the DOWNLOAD macro. Some sites need this. Thanks
Hiltjo Posthuma!
2012-11-20 11:53:29 +01:00
Christoph Lohmann a4e1d552ca Useragent strings do not count anymore. This is adding some text so every
website (especially Google) is fooled to believe us to be compatible. The
right way seems to be to add Surf at the end and let the big guys handle their
useragent header war.
2012-11-16 22:31:36 +01:00
Christoph Lohmann e7b36f693f Adding a surf-open.sh script for easier tabbed(1) integration. 2012-11-16 16:12:09 +01:00
Christoph Lohmann d6bbef74fe Moving some preprocessor config options to the standard suckless style. 2012-11-16 10:53:30 +01:00
Christoph Lohmann ba452c2e13 Adding back the Escape to stop loading the current page. Thanks Daniel Bainton
for the notice!
2012-11-16 10:42:30 +01:00
Christoph Lohmann f02e652fa0 Some minor style updates. 2012-11-16 10:31:42 +01:00
Christoph Lohmann 6d9d3ca4e1 Removing the insert mode. It will only confuse users. The stop() function is
kept like the eval() function because it could be used in config.h
2012-11-16 10:13:23 +01:00
Christoph Lohmann c12b6499fe Enable the insert mode. Thanks to stanio@cs.tu-berlin.de! 2012-11-15 15:26:48 +01:00
Christoph Lohmann d911219554 Applying the surf style to the last patch. 2012-11-15 14:53:27 +01:00
Christoph Lohmann a283fa4bc9 Importing the generic toggle patch of stanio@cs.tu-berlin.de. Thanks! 2012-11-15 14:52:22 +01:00
Christoph Lohmann 244dfd3231 Fixing the bug of surf loading undefined data in arg. 2012-11-08 22:05:40 +01:00
Christoph Lohmann d44bfb2c31 Fixing the manpage about the useragent option. 2012-10-31 21:25:42 +01:00
Christoph Lohmann 1bfda445ac Adding a useragent parameter to surf. 2012-10-31 21:25:14 +01:00
Christoph Lohmann 6aaaeb7267 Changing the config.def.h to fit the new buildpath() behaviour. 2012-10-31 21:16:12 +01:00
Christoph Lohmann 4ce3808684 Add options for scriptfile, cookiefile and stylefile. And changing the default
behaviour of buildpath to be more like in open().
2012-10-31 21:13:50 +01:00
Christoph Lohmann 0b885f18e3 Add different progress colors when using proxy. 2012-10-31 20:46:38 +01:00
Christoph Lohmann 25ba840e4d Hiding the loading indicator when it is not used. Based on a patch from
http://xteddy.org/surf.html#toc5. Thanks!
2012-10-28 14:16:22 +01:00
Christoph Lohmann 161247eaf4 Applying the patch to show the indicator only on loading. Based on a patch
from http://xteddy.org/surf.html#toc5.
2012-10-28 14:06:17 +01:00
Christoph Lohmann 3d3b105de7 Mod + '/' for search. 2012-10-28 14:03:00 +01:00
Christoph Lohmann 3058d5bf63 Applying the cookie patch of Carlos Pita. Thank you! 2012-10-16 21:54:37 +02:00
Christoph Lohmann 5703683638 Removing the double initialisation to webkit_get_default_session(). Thanks
taruti!
2012-10-16 15:41:50 +02:00
Christoph Lohmann 85d9d92e0b Reverting the cleanmask change. 2012-10-14 07:17:45 +02:00
Christoph Lohmann de3ed01386 Changing the key masks to the values of GDK. 2012-10-13 12:06:26 +02:00
Christoph Lohmann 81d23cb76d The right click menu to copy the link URI will now work. Thanks to Carlos
Pita!
2012-10-13 07:28:16 +02:00
Christoph Lohmann 2e92060efc Adding middle-click behaviour to open a tab when embedded or a window when
not. Thanks to Carlos Pita <carlosjosepita@gmail.com>!
2012-10-13 07:16:08 +02:00
Christoph Lohmann 23def74c98 Fixing the shift key mask and cleaning up the scrolling code. 2012-10-12 11:48:38 +02:00
Christoph Lohmann e28d27249e Surf now parses hex window ids properly from tabbed. 2012-07-16 16:35:47 +02:00
Troels Henriksen 635ed55fda Added tag 0.5 for changeset f0cea0f2bfc6 2012-07-12 12:41:56 +02:00
11 changed files with 836 additions and 282 deletions
+1
View File
@@ -7,3 +7,4 @@ a5db79d487c85615be2ecf30815c6b4977e88000 0.2
46d516fd216731adf91740496e6823c1be4f6199 0.3
ac8e058003ed2c0974529808752e5da7692fd7d8 0.4
71388899ac09d21e6c93518cc57a28395034f63c 0.4.1
f0cea0f2bfc6a32a0e352b6c69d781f1dbddbcda 0.5
+2
View File
@@ -2,6 +2,7 @@ MIT/X Consortium License
© 2011-2012 Troels Henriksen <athas@sigkill.at>
© 2009-2011 Enno Boland <g s01 de>
© 2012 Christoph Lohmann <20h@r-36.net>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -20,3 +21,4 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+1
View File
@@ -36,6 +36,7 @@ dist: clean
@echo creating dist tarball
@mkdir -p surf-${VERSION}
@cp -R LICENSE Makefile config.mk config.def.h README \
surf-open.sh arg.h TODO.md surf.png \
surf.1 ${SRC} surf-${VERSION}
@tar -cf surf-${VERSION}.tar surf-${VERSION}
@gzip surf-${VERSION}.tar
+16 -3
View File
@@ -2,7 +2,6 @@ surf - simple webkit-based browser
==================================
surf is a simple Web browser based on WebKit/GTK+.
Requirements
------------
In order to build surf you need GTK+ and Webkit/GTK+ header files.
@@ -18,8 +17,22 @@ necessary as root):
make clean install
Running surf
------------
run
surf [URL]
surf [URI]
See the manpage for further options.
Running surf in tabbed
----------------------
For running surf in tabbed[0] there is a script included in the distribution,
which is run like this:
surf-open.sh [URI]
Further invocations of the script will run surf with the specified URI in this
instance of tabbed.
[0] http://tools.suckless.org/tabbed
+11
View File
@@ -0,0 +1,11 @@
# TODO
* suckless adblocking
* integrate the WebKitWebInspector API
* make scrollbars a switch and allow them to be disabled
* replace webkit with something sane
* add video player options
* play in plugin
* play in video player
* call command with URI (quvi + cclive)
+41
View File
@@ -0,0 +1,41 @@
/*
* Copy me if you can.
* by 20h
*/
#ifndef __ARG_H__
#define __ARG_H__
extern char *argv0;
#define USED(x) ((void)(x))
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][1]\
&& argv[0][0] == '-';\
argc--, argv++) {\
char _argc;\
char **_argv;\
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
argv++;\
argc--;\
break;\
}\
for (argv[0]++, _argv = argv; argv[0][0];\
argv[0]++) {\
if (_argv != argv)\
break;\
_argc = argv[0][0];\
switch (_argc)
#define ARGEND }\
USED(_argc);\
}\
USED(argv);\
USED(argc);
#define EARGF(x) ((argv[1] == NULL)? ((x), abort(), (char *)0) :\
(argc--, argv++, argv[0]))
#endif
+63 -17
View File
@@ -1,49 +1,95 @@
/* modifier 0 means no modifier */
static char *useragent = "Surf/"VERSION" (X11; U; Unix; en-US) AppleWebKit/531.2+ Compatible (Safari)";
static char *progress = "#0066FF";
static char *progress_untrust = "#FF6600";
static char *useragent = "Mozilla/5.0 (X11; U; Unix; en-US) "
"AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 "
"Safari/537.15 Surf/"VERSION;
static char *progress = "#0000FF";
static char *progress_untrust = "#FF0000";
static char *progress_trust = "#00FF00";
static char *stylefile = ".surf/style.css";
static char *scriptfile = ".surf/script.js";
static char *cookiefile = ".surf/cookies.txt";
static char *progress_proxy = "#FFFF00";
static char *progress_proxy_trust = "#66FF00";
static char *progress_proxy_untrust = "#FF6600";
static char *stylefile = "~/.surf/style.css";
static char *scriptfile = "~/.surf/script.js";
static char *cookiefile = "~/.surf/cookies.txt";
static time_t sessiontime = 3600;
static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
#define HIDE_BACKGROUND FALSE
#define SPATIAL_BROWSING TRUE
static int indicator_thickness = 2;
#define SETPROP(p, q) { .v = (char *[]){ "/bin/sh", "-c", \
"prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
p, q, winid, NULL } }
#define DOWNLOAD(d) { \
/* Webkit default features */
static Bool enablespatialbrowsing = TRUE;
static Bool enableplugins = TRUE;
static Bool enablescripts = TRUE;
static Bool enableinspector = TRUE;
static Bool loadimages = TRUE;
static Bool hidebackground = FALSE;
#define SETPROP(p, q) { \
.v = (char *[]){ "/bin/sh", "-c", \
"xterm -e \"wget '$0' \
--load-cookies ~/.surf/cookies.txt \
--user-agent '$1' ; sleep 5\"", d, useragent, NULL } }
"prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
p, q, winid, NULL \
} \
}
/* DOWNLOAD(URI, referer) */
#define DOWNLOAD(d, r) { \
.v = (char *[]){ "/bin/sh", "-c", \
"st -e /bin/sh -c \"curl -J -O --user-agent '$1'" \
" --referer '$2'" \
" -b ~/.surf/cookies.txt -c ~/.surf/cookies.txt '$0';" \
" sleep 5;\"", \
d, useragent, r, NULL \
} \
}
#define MODKEY GDK_CONTROL_MASK
/* hotkeys */
/*
* If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
* edit the CLEANMASK() macro.
*/
static Key keys[] = {
/* modifier keyval function arg Focus */
{ MODKEY|GDK_SHIFT_MASK,GDK_r, reload, { .b = TRUE } },
{ MODKEY, GDK_r, reload, { .b = FALSE } },
{ MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 } },
{ MODKEY, GDK_p, clipboard, { .b = TRUE } },
{ MODKEY, GDK_y, clipboard, { .b = FALSE } },
{ MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_k, zoom, { .i = +1 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_i, zoom, { .i = 0 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_q, zoom, { .i = 0 } },
{ MODKEY, GDK_minus, zoom, { .i = -1 } },
{ MODKEY, GDK_plus, zoom, { .i = +1 } },
{ MODKEY, GDK_l, navigate, { .i = +1 } },
{ MODKEY, GDK_h, navigate, { .i = -1 } },
{ MODKEY, GDK_j, scroll_v, { .i = +1 } },
{ MODKEY, GDK_k, scroll_v, { .i = -1 } },
{ MODKEY, GDK_b, scroll_v, { .i = -10000 } },
{ MODKEY, GDK_space, scroll_v, { .i = +10000 } },
{ MODKEY, GDK_i, scroll_h, { .i = +1 } },
{ MODKEY, GDK_u, scroll_h, { .i = -1 } },
{ 0, GDK_F11, fullscreen, { 0 } },
{ 0, GDK_Escape, stop, { 0 } },
{ MODKEY, GDK_o, source, { 0 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_o, inspector, { 0 } },
{ MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") },
{ MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
{ MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
{ MODKEY, GDK_n, find, { .b = TRUE } },
{ MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } },
{ MODKEY|GDK_SHIFT_MASK,GDK_c, toggle, { .v = "enable-caret-browsing" } },
{ MODKEY|GDK_SHIFT_MASK,GDK_i, toggle, { .v = "auto-load-images" } },
{ MODKEY|GDK_SHIFT_MASK,GDK_s, toggle, { .v = "enable-scripts" } },
{ MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } },
};
+3 -4
View File
@@ -1,5 +1,5 @@
# surf version
VERSION = 0.5
VERSION = 0.6
# Customize below to fit your system
@@ -15,11 +15,10 @@ GTKLIB = `pkg-config --libs gtk+-2.0 webkit-1.0`
# includes and libs
INCS = -I. -I/usr/include -I${X11INC} ${GTKINC}
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0 \
-ljavascriptcoregtk-1.0
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\"
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -g ${LIBS}
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
#
# See the LICENSE file for copyright and license details.
#
xidfile="$HOME/tmp/tabbed-surf.xid"
uri=""
if [ "$#" -gt 0 ];
then
uri="$1"
fi
runtabbed() {
tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
2>/dev/null &
}
if [ ! -r "$xidfile" ];
then
runtabbed
else
xid=$(cat "$xidfile")
xprop -id "$xid" 2>&1 >/dev/null
if [ $? -gt 0 ];
then
runtabbed
else
surf -e "$xid" "$uri" 2>&1 >/dev/null &
fi
fi
+77 -12
View File
@@ -3,12 +3,12 @@
surf \- simple webkit-based browser
.SH SYNOPSIS
.B surf
.RB [-ipnsvx]
.RB [-c\ cookiefile]
.RB [-e\ xid]
.RB [-i]
.RB [-p]
.RB [-s]
.RB [-v]
.RB [-x]
.RB [-r\ scriptfile]
.RB [-t\ stylefile]
.RB [-u\ useragent]
.RB "URI"
.SH DESCRIPTION
surf is a simple Web browser based on WebKit/GTK+. It is able
@@ -17,18 +17,33 @@ which makes it possible to embed it in another application. Furthermore,
one can point surf to another URI by setting its XProperties.
.SH OPTIONS
.TP
.B \-c cookiefile
Specify the cookiefile to use.
.TP
.B \-e xid
Reparents to window specified by xid.
.TP
.B \-i
Disable Images
.TP
.B \-n
Disable the Web Inspector (Developer Tools).
.TP
.B \-p
Disable Plugins
.TP
.B \-r scriptfile
Specify the user scriptfile.
.TP
.B \-s
Disable Javascript
.TP
.B \-t stylefile
Specify the user stylefile.
.TP
.B \-u useragent
Specify the useragent which surf should use.
.TP
.B \-v
Prints version information to standard output, then exits.
.TP
@@ -51,16 +66,34 @@ Scrolls page upwards.
.B Ctrl\-j
Scrolls page downwards.
.TP
.B Ctrl\-Shift\-k
.B Ctrl\-b
Scroll up one whole page view.
.TP
.B Ctrl\-Space
Scroll down one whole page view.
.TP
.B Ctrl\-i
Scroll horizontally to the right.
.TP
.B Ctrl\-u
Scroll horizontally to the left.
.TP
.B Ctrl\-Shift\-k or Ctrl\-+
Zooms page in.
.TP
.B Ctrl\-Shift\-j
.B Ctrl\-Shift\-j or Ctrl\--
Zooms page out
.TP
.B Ctrl\-Shift\-i
.B Ctrl\-Shift\-q
Resets Zoom
.TP
.B Ctrl\-f
.B Ctrl\-h
Navigate back one step in history.
.TP
.B Ctrl\-l
Navigate forward one step in history.
.TP
.B Ctrl\-f and Ctrl\-\\
Opens the search-bar.
.TP
.B Ctrl\-n
@@ -75,6 +108,9 @@ Opens the URL-bar.
.B Ctrl\-p
Loads URI from primary selection.
.TP
.B Esc
Stop loading the page.
.TP
.B Ctrl\-Shift\-p
Calls Printpage Dialog.
.TP
@@ -88,17 +124,46 @@ Reloads the website without using cache.
Copies current URI to primary selection.
.TP
.B Ctrl\-o
show the sourcecode of the current page.
.SH ENVIRONMENT
Show the sourcecode of the current page.
.TP
.B Ctrl\-Shift\-o
Open the Web Inspector (Developer Tools) window for the current page.
.TP
.B Ctrl\-Shift\-c
Toggle caret browsing.
.TP
.B Ctrl\-Shift\-i
Toggle auto-loading of images.
.TP
.B Ctrl\-Shift\-s
Toggle script execution.
.TP
.B Ctrl\-Shift\-v
Toggle the enabling of plugins on that surf instance.
.TP
.B F11
Toggle fullscreen mode.
.SH ENVIRONMENT
.B SURF_USERAGENT
If this variable is set upon startup, surf will use it as the useragent string
.TP
.B http_proxy
If this variable is set and not empty upon startup, surf will use it as the http proxy
.SH PLUGINS
For using plugins in surf, first determine your running architecture. Then get
the appropriate plugin for that architecture and copy it to
.BR /usr/lib/browser-plugins
or
.BR /usr/lib64/browser-plugins.
Surf should load them automatically.
.BR
If you want to use a 32bit plugin on a 64bit system,
.BR nspluginwrapper(1)
will help you.
.SH SEE ALSO
.BR dmenu(1),
.BR xprop(1),
.BR tabbed(1)
.BR tabbed(1),
.BR nspluginwrapper(1)
.SH BUGS
Please report them!
+589 -246
View File
File diff suppressed because it is too large Load Diff