Compare commits
171 Commits
0.5
..
surf-webkit1
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c640fe0f5 | |||
| 9ba143baba | |||
| 58634c74b3 | |||
| ab16fa5e7c | |||
| dcabd0239e | |||
| 6c8da4c851 | |||
| 31ec0fb93d | |||
| 1308872b8b | |||
| f5e8baad06 | |||
| 842103322c | |||
| 7895fb9c5d | |||
| fd6e80a279 | |||
| 743fa9f3d1 | |||
| 0ac6bf5a97 | |||
| 3d81a0f0b7 | |||
| 018a67986d | |||
| 3393ded725 | |||
| cd7f831776 | |||
| 86efaf8093 | |||
| 9fa4ffef72 | |||
| 002e82d188 | |||
| bae5a785b3 | |||
| b7a359a84f | |||
| 9b1e1873b0 | |||
| 5333171961 | |||
| 2223e9ed22 | |||
| 1ebb5c624e | |||
| 9a2547230a | |||
| 0290066b31 | |||
| d84fe71094 | |||
| d486169fa4 | |||
| c65c8d422b | |||
| 9f5c6ff8d7 | |||
| c2bb8d0325 | |||
| 6a65dcb394 | |||
| c81fbbaf43 | |||
| 8a898ec4df | |||
| 1554354f16 | |||
| 3c2acda0b7 | |||
| 8e88984a40 | |||
| 294142a806 | |||
| 957a6f0812 | |||
| 9b6998e7ae | |||
| b4ca032b8c | |||
| 29c2ab207a | |||
| f7e358280c | |||
| b3a4392923 | |||
| b1c5e594d1 | |||
| e573e094d6 | |||
| ee6376ea1e | |||
| 90de5cdd15 | |||
| 344efec3fb | |||
| d4e31d9472 | |||
| 68813b3a46 | |||
| 87224dcdfa | |||
| d511226ea6 | |||
| b36921fbe8 | |||
| 9c3b5ad353 | |||
| 7c34d5061e | |||
| 9333d5d727 | |||
| e7d1c09916 | |||
| 117d484833 | |||
| 24ec46fc24 | |||
| a5b85836ac | |||
| c2da2bae5d | |||
| c467e5a3b3 | |||
| 3e89b4451c | |||
| dd705d43eb | |||
| 531f71f851 | |||
| d5b04aac60 | |||
| bb287fa2e8 | |||
| 285cc3843f | |||
| ea9d60c5c0 | |||
| f8f0c30f3e | |||
| a8267f7b95 | |||
| 618c3dfd52 | |||
| 3cc5f87db8 | |||
| 637902b452 | |||
| 127dc366ef | |||
| 361da0b3c4 | |||
| b7435badc2 | |||
| 4b623bd28a | |||
| 7ad886fb0b | |||
| fa9b187393 | |||
| 780cca964c | |||
| e4869357f1 | |||
| a78aec6630 | |||
| 9eedabe348 | |||
| 432f45a852 | |||
| 7e9a37f25f | |||
| 83df29393f | |||
| f3d97922e9 | |||
| 237e10058a | |||
| 058f7f45e2 | |||
| 7001df98d1 | |||
| 2e978627dd | |||
| 0b44a5948e | |||
| c234737bea | |||
| 4f45ae9307 | |||
| ffaf10bd8f | |||
| 067c313e6c | |||
| d0309a1a22 | |||
| 083ea8ecde | |||
| a383964c95 | |||
| e0e4a844f7 | |||
| f6dc8b2541 | |||
| 12101938d8 | |||
| bccfe2a9a5 | |||
| dcb4f81ad2 | |||
| a69c41ccac | |||
| d02f73d990 | |||
| a5dddd8fd3 | |||
| c6fbbd9dc6 | |||
| badb84387e | |||
| fe3bd631d4 | |||
| 69004b2ff6 | |||
| bd5bbb7fc3 | |||
| 3e972f8e2a | |||
| 053a8f1a73 | |||
| ba634ea8e3 | |||
| 24f0f83197 | |||
| 3c1ed5d56a | |||
| 27dac4a157 | |||
| 606c6e3297 | |||
| 076d9f2350 | |||
| 43840c8528 | |||
| d6a3e28be2 | |||
| 77036565da | |||
| 8c15f0e758 | |||
| 0415175e10 | |||
| e784d925df | |||
| 13b04d8b61 | |||
| a013f0857e | |||
| 6ddc8a80fd | |||
| 3dd006f1c1 | |||
| 96e3ae41dd | |||
| 0dfdb75804 | |||
| 1f30ddf224 | |||
| 760f8f36de | |||
| e96f191088 | |||
| 6cd54e4a31 | |||
| ad794e0f00 | |||
| 5501d75d2c | |||
| a7ea753f93 | |||
| a4e1d552ca | |||
| e7b36f693f | |||
| d6bbef74fe | |||
| ba452c2e13 | |||
| f02e652fa0 | |||
| 6d9d3ca4e1 | |||
| c12b6499fe | |||
| d911219554 | |||
| a283fa4bc9 | |||
| 244dfd3231 | |||
| d44bfb2c31 | |||
| 1bfda445ac | |||
| 6aaaeb7267 | |||
| 4ce3808684 | |||
| 0b885f18e3 | |||
| 25ba840e4d | |||
| 161247eaf4 | |||
| 3d3b105de7 | |||
| 3058d5bf63 | |||
| 5703683638 | |||
| 85d9d92e0b | |||
| de3ed01386 | |||
| 81d23cb76d | |||
| 2e92060efc | |||
| 23def74c98 | |||
| e28d27249e | |||
| 635ed55fda |
@@ -1,9 +0,0 @@
|
||||
d8628fc93353faa411c9fc7eef82d11a84d26ae2 0.1
|
||||
d8628fc93353faa411c9fc7eef82d11a84d26ae2 0.1
|
||||
9c8ebcf54061112b5979742b403de26fc94007ff 0.1
|
||||
3ef997607115303fe93873b592d152f0ec186f77 0.1.1
|
||||
bffb0c3c23410ac7f260d167f4b9771497fc1127 0.1.2
|
||||
a5db79d487c85615be2ecf30815c6b4977e88000 0.2
|
||||
46d516fd216731adf91740496e6823c1be4f6199 0.3
|
||||
ac8e058003ed2c0974529808752e5da7692fd7d8 0.4
|
||||
71388899ac09d21e6c93518cc57a28395034f63c 0.4.1
|
||||
@@ -0,0 +1,85 @@
|
||||
Code of Conduct
|
||||
===============
|
||||
|
||||
> ==Phrack Inc.==
|
||||
> Volume One, Issue 7, Phile 3 of 10
|
||||
>
|
||||
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
>
|
||||
> The following was written shortly after my arrest...
|
||||
>
|
||||
> \/\The Conscience of a Hacker/\/
|
||||
>
|
||||
> by
|
||||
>
|
||||
> +++The Mentor+++
|
||||
>
|
||||
> Written on January 8, 1986
|
||||
>
|
||||
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
>
|
||||
> Another one got caught today, it's all over the papers. "Teenager
|
||||
> Arrested in Computer Crime Scandal", "Hacker Arrested after Bank Tampering"...
|
||||
> Damn kids. They're all alike.
|
||||
>
|
||||
> But did you, in your three-piece psychology and 1950's technobrain,
|
||||
> ever take a look behind the eyes of the hacker? Did you ever wonder what
|
||||
> made him tick, what forces shaped him, what may have molded him?
|
||||
> I am a hacker, enter my world...
|
||||
> Mine is a world that begins with school... I'm smarter than most of
|
||||
> the other kids, this crap they teach us bores me...
|
||||
> Damn underachiever. They're all alike.
|
||||
>
|
||||
> I'm in junior high or high school. I've listened to teachers explain
|
||||
> for the fifteenth time how to reduce a fraction. I understand it. "No, Ms.
|
||||
> Smith, I didn't show my work. I did it in my head..."
|
||||
> Damn kid. Probably copied it. They're all alike.
|
||||
>
|
||||
> I made a discovery today. I found a computer. Wait a second, this is
|
||||
> cool. It does what I want it to. If it makes a mistake, it's because I
|
||||
> screwed it up. Not because it doesn't like me...
|
||||
> Or feels threatened by me...
|
||||
> Or thinks I'm a smart ass...
|
||||
> Or doesn't like teaching and shouldn't be here...
|
||||
> Damn kid. All he does is play games. They're all alike.
|
||||
>
|
||||
> And then it happened... a door opened to a world... rushing through
|
||||
> the phone line like heroin through an addict's veins, an electronic pulse is
|
||||
> sent out, a refuge from the day-to-day incompetencies is sought... a board is
|
||||
> found.
|
||||
> "This is it... this is where I belong..."
|
||||
> I know everyone here... even if I've never met them, never talked to
|
||||
> them, may never hear from them again... I know you all...
|
||||
> Damn kid. Tying up the phone line again. They're all alike...
|
||||
>
|
||||
> You bet your ass we're all alike... we've been spoon-fed baby food at
|
||||
> school when we hungered for steak... the bits of meat that you did let slip
|
||||
> through were pre-chewed and tasteless. We've been dominated by sadists, or
|
||||
> ignored by the apathetic. The few that had something to teach found us will-
|
||||
> ing pupils, but those few are like drops of water in the desert.
|
||||
>
|
||||
> This is our world now... the world of the electron and the switch, the
|
||||
> beauty of the baud. We make use of a service already existing without paying
|
||||
> for what could be dirt-cheap if it wasn't run by profiteering gluttons, and
|
||||
> you call us criminals. We explore... and you call us criminals. We seek
|
||||
> after knowledge... and you call us criminals. We exist without skin color,
|
||||
> without nationality, without religious bias... and you call us criminals.
|
||||
> You build atomic bombs, you wage wars, you murder, cheat, and lie to us
|
||||
> and try to make us believe it's for our own good, yet we're the criminals.
|
||||
>
|
||||
> Yes, I am a criminal. My crime is that of curiosity. My crime is
|
||||
> that of judging people by what they say and think, not what they look like.
|
||||
> My crime is that of outsmarting you, something that you will never forgive me
|
||||
> for.
|
||||
>
|
||||
> I am a hacker, and this is my manifesto. You may stop this individual,
|
||||
> but you can't stop us all... after all, we're all alike.
|
||||
|
||||
Keep to your sanity, question the world, even this manifest.
|
||||
|
||||
Don't follow morals, nothing is right or wrong.
|
||||
|
||||
Have fun.
|
||||
|
||||
Yours project maintainer on 2016-01-27.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
## Surf is starting up slowly. What might happen?
|
||||
|
||||
The first suspect for such a behaviour is the plugin handling. Run surf
|
||||
on the commandline and see if there are errors because of »nspluginwrap‐
|
||||
per« or failed RPCs to them. If that is true, go to ~/.mozilla/plugins
|
||||
and try removing stale links to plugins not on your system anymore. This
|
||||
will stop surf from trying to load them.
|
||||
|
||||
@@ -1,7 +1,32 @@
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2011-2012 Troels Henriksen <athas@sigkill.at>
|
||||
© 2009-2011 Enno Boland <g s01 de>
|
||||
© 2009-2010 Enno Boland <tox@s01.de>
|
||||
© 2009 Thomas Menari <spaceinvader@chaotika.org>
|
||||
© 2009 Simon Rozet <simon@rozet.name>
|
||||
© 2009 Andrew Antle <andrew.antle@gmail.com>
|
||||
© 2010-2011 pancake <nopcode.org>
|
||||
© 2011-2013 Anselm R Garbe <anselm@garbe.us>
|
||||
© 2011-2012 Troels Henriksen <athas@sigkill.dk>
|
||||
© 2011 Connor Lane Smith <cls@lubutu.com>
|
||||
© 2012-2017 Christoph Lohmann <20h@r-36.net>
|
||||
© 2013 Shayan Pooya <shayan@liveve.org>
|
||||
© 2013 Jens Nyberg <jens.nyberg@gmail.com>
|
||||
© 2013 Carlos J. Torres <vlaadbrain@gmail.com>
|
||||
© 2013 Alexander Sedov <alex0player@gmail.com>
|
||||
© 2013 Nick White <git@njw.me.uk>
|
||||
© 2013 David Dufberg <david@dufberg.se>
|
||||
© 2014-2017 Quentin Rameau <quinq@fifth.space>
|
||||
© 2014-2016 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
© 2015 Jakukyo Friel <weakish@gmail.com>
|
||||
© 2015 Ben Woolley <tautolog@gmail.com>
|
||||
© 2015 Greg Reagle <greg.reagle@umbc.edu>
|
||||
© 2015 GhostAV <ghostav@riseup.net>
|
||||
© 2015 Ivan Tham <pickfire@riseup.net>
|
||||
© 2015 Alexander Huemer <alexander.huemer@xx.vu>
|
||||
© 2015 Michael Stevens <mstevens@etla.org>
|
||||
© 2015 Felix Janda <felix.janda@posteo.de>
|
||||
© 2016 Charles Lehner <cel@celehner.com>
|
||||
© 2016 Dmitry Bogatov <KAction@gnu.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
@@ -20,3 +45,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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,11 +2,11 @@ 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.
|
||||
|
||||
In order to use the functionality of the url-bar, also install dmenu[0].
|
||||
|
||||
Installation
|
||||
------------
|
||||
@@ -18,8 +18,23 @@ 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[1] 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/dmenu
|
||||
[1] http://tools.suckless.org/tabbed
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# TODO
|
||||
|
||||
* suckless adblocking
|
||||
* replace twitch() with proper gtk calls to make scrollbars reappear
|
||||
* replace webkit with something sane
|
||||
* add video player options
|
||||
* play in plugin
|
||||
* play in video player
|
||||
* call command with URI (quvi + cclive)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copy me if you can.
|
||||
* by 20h
|
||||
*/
|
||||
|
||||
#ifndef ARG_H__
|
||||
#define ARG_H__
|
||||
|
||||
extern char *argv0;
|
||||
|
||||
/* use main(int argc, char *argv[]) */
|
||||
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||
argv[0] && argv[0][0] == '-'\
|
||||
&& argv[0][1];\
|
||||
argc--, argv++) {\
|
||||
char argc_;\
|
||||
char **argv_;\
|
||||
int brk_;\
|
||||
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||
argv++;\
|
||||
argc--;\
|
||||
break;\
|
||||
}\
|
||||
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||
argv[0][0] && !brk_;\
|
||||
argv[0]++) {\
|
||||
if (argv_ != argv)\
|
||||
break;\
|
||||
argc_ = argv[0][0];\
|
||||
switch (argc_)
|
||||
#define ARGEND }\
|
||||
}
|
||||
|
||||
#define ARGC() argc_
|
||||
|
||||
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
((x), abort(), (char *)0) :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
(char *)0 :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#endif
|
||||
+139
-45
@@ -1,49 +1,143 @@
|
||||
/* 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 *progress_trust = "#00FF00";
|
||||
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 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 *scriptfile = "~/.surf/script.js";
|
||||
static char *styledir = "~/.surf/styles/";
|
||||
static char *cachefolder = "~/.surf/cache/";
|
||||
|
||||
#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) { \
|
||||
static Bool kioskmode = FALSE; /* Ignore shortcuts */
|
||||
static Bool showindicators = TRUE; /* Show indicators in window title */
|
||||
static Bool zoomto96dpi = TRUE; /* Zoom pages to always emulate 96dpi */
|
||||
static Bool runinfullscreen = FALSE; /* Run in fullscreen mode by default */
|
||||
|
||||
static guint defaultfontsize = 12; /* Default font size */
|
||||
static gfloat zoomlevel = 1.0; /* Default zoom level */
|
||||
|
||||
/* Soup default features */
|
||||
static char *cookiefile = "~/.surf/cookies.txt";
|
||||
static char *cookiepolicies = "Aa@"; /* A: accept all; a: accept nothing,
|
||||
* @: accept all except third party */
|
||||
static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
|
||||
static Bool strictssl = FALSE; /* Refuse untrusted SSL connections */
|
||||
static time_t sessiontime = 3600;
|
||||
|
||||
/* Webkit default features */
|
||||
static Bool enablescrollbars = TRUE;
|
||||
static Bool enablespatialbrowsing = TRUE;
|
||||
static Bool enablediskcache = TRUE;
|
||||
static int diskcachebytes = 5 * 1024 * 1024;
|
||||
static Bool enableplugins = TRUE;
|
||||
static Bool enablescripts = TRUE;
|
||||
static Bool enableinspector = TRUE;
|
||||
static Bool enablestyle = TRUE;
|
||||
static Bool loadimages = TRUE;
|
||||
static Bool hidebackground = FALSE;
|
||||
static Bool allowgeolocation = TRUE;
|
||||
|
||||
#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 } }
|
||||
#define MODKEY GDK_CONTROL_MASK
|
||||
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_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_Escape, stop, { 0 } },
|
||||
{ MODKEY, GDK_o, source, { 0 } },
|
||||
{ MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") },
|
||||
{ MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
|
||||
{ MODKEY, GDK_n, find, { .b = TRUE } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } },
|
||||
"prop=\"`xprop -id $2 $0 " \
|
||||
"| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \
|
||||
"| xargs -0 printf %b | 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 -g -L -J -O --user-agent '$1'" \
|
||||
" --referer '$2' -b $3 -c $3 '$0';" \
|
||||
" sleep 5;\"", \
|
||||
d, useragent, r, cookiefile, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* PLUMB(URI) */
|
||||
/* This called when some URI which does not begin with "about:",
|
||||
* "http://" or "https://" should be opened.
|
||||
*/
|
||||
#define PLUMB(u) {\
|
||||
.v = (char *[]){ "/bin/sh", "-c", \
|
||||
"xdg-open \"$0\"", u, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* styles */
|
||||
/*
|
||||
* The iteration will stop at the first match, beginning at the beginning of
|
||||
* the list.
|
||||
*/
|
||||
static SiteStyle styles[] = {
|
||||
/* regexp file in $styledir */
|
||||
{ ".*", "default.css" },
|
||||
};
|
||||
|
||||
#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_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" } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_a, togglecookiepolicy, { 0 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_m, togglestyle, { 0 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_b, togglescrollbars, { 0 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_y, toggleproxy, { 0 } },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLink, 0, 2, linkopenembed, { 0 } },
|
||||
{ ClkLink, MODKEY, 2, linkopen, { 0 } },
|
||||
{ ClkLink, MODKEY, 1, linkopen, { 0 } },
|
||||
{ ClkAny, 0, 8, navigate, { .i = -1 } },
|
||||
{ ClkAny, 0, 9, navigate, { .i = +1 } },
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# surf version
|
||||
VERSION = 0.5
|
||||
VERSION = 1.8
|
||||
|
||||
# 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_DEFAULT_SOURCE
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = -g ${LIBS}
|
||||
|
||||
|
||||
Executable
+32
@@ -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" >/dev/null 2>&1
|
||||
if [ $? -gt 0 ];
|
||||
then
|
||||
runtabbed
|
||||
else
|
||||
surf -e "$xid" "$uri" >/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
surf \- simple webkit-based browser
|
||||
.SH SYNOPSIS
|
||||
.B surf
|
||||
.RB [-bBdDfFgGiIkKmMnNpPsSvx]
|
||||
.RB [-a\ cookiepolicies]
|
||||
.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 [-z\ zoomlevel]
|
||||
.RB "URI"
|
||||
.SH DESCRIPTION
|
||||
surf is a simple Web browser based on WebKit/GTK+. It is able
|
||||
@@ -17,23 +19,111 @@ 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 \-a cookiepolicies
|
||||
Define the order of
|
||||
.I cookie policies.
|
||||
The default is "Aa@" but could be
|
||||
redefined in the
|
||||
.I config.h,
|
||||
with "A" meaning to
|
||||
accept all cookies, "a" to deny all cookies and "@", which tells surf to
|
||||
accept no third party cookies.
|
||||
.TP
|
||||
.B \-b
|
||||
Disable Scrollbars
|
||||
.TP
|
||||
.B \-B
|
||||
Enable Scrollbars
|
||||
.TP
|
||||
.B \-c cookiefile
|
||||
Specify the
|
||||
.I cookiefile
|
||||
to use.
|
||||
.TP
|
||||
.B \-d
|
||||
Disable the disk cache.
|
||||
.TP
|
||||
.B \-D
|
||||
Enable the disk cache.
|
||||
.TP
|
||||
.B \-e xid
|
||||
Reparents to window specified by xid.
|
||||
Reparents to window specified by
|
||||
.I xid.
|
||||
.TP
|
||||
.B \-f
|
||||
Start surf in windowed mode (not fullscreen).
|
||||
.TP
|
||||
.B \-F
|
||||
Start surf in fullscreen mode.
|
||||
.TP
|
||||
.B \-g
|
||||
Disable giving the geolocation to websites.
|
||||
.TP
|
||||
.B \-G
|
||||
Enable giving the geolocation to websites.
|
||||
.TP
|
||||
.B \-i
|
||||
Disable Images
|
||||
.TP
|
||||
.B \-I
|
||||
Enable Images
|
||||
.TP
|
||||
.B \-k
|
||||
Disable kiosk mode (disable key strokes and right click)
|
||||
.TP
|
||||
.B \-K
|
||||
Enable kiosk mode (disable key strokes and right click)
|
||||
.TP
|
||||
.B \-m
|
||||
Disable application of user style sheets.
|
||||
.TP
|
||||
.B \-M
|
||||
Enable application of user style sheets.
|
||||
.TP
|
||||
.B \-n
|
||||
Disable the Web Inspector (Developer Tools).
|
||||
.TP
|
||||
.B \-N
|
||||
Enable the Web Inspector (Developer Tools).
|
||||
.TP
|
||||
.B \-p
|
||||
Disable Plugins
|
||||
.TP
|
||||
.B \-P
|
||||
Enable Plugins
|
||||
.TP
|
||||
.B \-r scriptfile
|
||||
Specify the user
|
||||
.I scriptfile.
|
||||
.TP
|
||||
.B \-s
|
||||
Disable Javascript
|
||||
.TP
|
||||
.B \-S
|
||||
Enable Javascript
|
||||
.TP
|
||||
.B \-t stylefile
|
||||
Specify the user
|
||||
.I stylefile.
|
||||
This does disable the site-specific styles.
|
||||
.TP
|
||||
.B \-u useragent
|
||||
Specify the
|
||||
.I useragent
|
||||
which surf should use.
|
||||
.TP
|
||||
.B \-v
|
||||
Prints version information to standard output, then exits.
|
||||
.TP
|
||||
.B \-x
|
||||
Prints xid to standard output. This can be used to script the browser by using
|
||||
Prints xid to standard output. This can be used to script the browser in for
|
||||
example
|
||||
.BR xdotool(1).
|
||||
.TP
|
||||
.B \-z zoomlevel
|
||||
Specify the
|
||||
.I zoomlevel
|
||||
which surf should use.
|
||||
.BR xprop(1).
|
||||
.SH USAGE
|
||||
.B Escape
|
||||
@@ -51,16 +141,28 @@ 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\-f and Ctrl\-/
|
||||
Opens the search-bar.
|
||||
.TP
|
||||
.B Ctrl\-n
|
||||
@@ -70,7 +172,7 @@ Go to next search result.
|
||||
Go to previous search result.
|
||||
.TP
|
||||
.B Ctrl\-g
|
||||
Opens the URL-bar.
|
||||
Opens the URL-bar (requires dmenu installed).
|
||||
.TP
|
||||
.B Ctrl\-p
|
||||
Loads URI from primary selection.
|
||||
@@ -82,23 +184,131 @@ Calls Printpage Dialog.
|
||||
Reloads the website.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-r
|
||||
Reloads the website without using cache.
|
||||
Reloads the website without using the cache.
|
||||
.TP
|
||||
.B Ctrl\-y
|
||||
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\-a
|
||||
Toggle through the the
|
||||
.I cookie policies.
|
||||
This will not reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-b
|
||||
Toggle scrollbars. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-c
|
||||
Toggle caret browsing. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-i
|
||||
Toggle auto-loading of images. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-m
|
||||
Toggle if the
|
||||
.I stylefile
|
||||
file should be loaded. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-o
|
||||
Open the Web Inspector (Developer Tools) window for the current page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-s
|
||||
Toggle script execution. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-v
|
||||
Toggle the enabling of plugins on that surf instance. This will reload the
|
||||
page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-y
|
||||
Toggle if a proxy should be used (if one is set in the environment).
|
||||
.TP
|
||||
.B F11
|
||||
Toggle fullscreen mode.
|
||||
.SH INDICATORS OF OPERATION
|
||||
Surf is showing indicators of operation in front of the site title.
|
||||
For all indicators, unless otherwise specified, a lower case letter means disabled and an upper case letter means enabled.
|
||||
.TP
|
||||
.B A
|
||||
all cookies accepted
|
||||
.TP
|
||||
.B a
|
||||
no cookies accepted
|
||||
.TP
|
||||
.B @
|
||||
all except third-party cookies accepted
|
||||
.TP
|
||||
.B c C
|
||||
caret browsing
|
||||
.TP
|
||||
.B g G
|
||||
geolocation
|
||||
.TP
|
||||
.B d D
|
||||
disk cache
|
||||
.TP
|
||||
.B i I
|
||||
images
|
||||
.TP
|
||||
.B s S
|
||||
scripts
|
||||
.TP
|
||||
.B v V
|
||||
plugins
|
||||
.TP
|
||||
.B m M
|
||||
styles
|
||||
.SH INDICATORS OF WEB PAGE
|
||||
The second part of the indicators specifies modes of the web page itself.
|
||||
.SS First character: encryption
|
||||
.TP
|
||||
.B -
|
||||
unencrypted
|
||||
.TP
|
||||
.B T
|
||||
encrypted (SSL)
|
||||
.TP
|
||||
.B U
|
||||
attempted encryption but failed
|
||||
.SS Second character: proxying
|
||||
.TP
|
||||
.B -
|
||||
no proxy
|
||||
.TP
|
||||
.B P
|
||||
using proxy
|
||||
.SH ENVIRONMENT
|
||||
.B SURF_USERAGENT
|
||||
If this variable is set upon startup, surf will use it as the useragent string
|
||||
If this variable is set upon startup, surf will use it as the
|
||||
.I useragent
|
||||
string
|
||||
.TP
|
||||
.B http_proxy
|
||||
If this variable is set and not empty upon startup, surf will use it as the http proxy
|
||||
.TP
|
||||
.B no_proxy
|
||||
If both http_proxy is set and no_proxy contain a
|
||||
.BR comma-separated
|
||||
list of domain extensions and both is not empty upon startup, proxy will
|
||||
.BR not
|
||||
be used for each of the elements in no_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),
|
||||
.BR xdotool(1)
|
||||
.SH BUGS
|
||||
Please report them!
|
||||
|
||||
Reference in New Issue
Block a user