Compare commits
223 Commits
0.7
...
surf-webkit2
| Author | SHA1 | Date | |
|---|---|---|---|
| 85d2bb6cad | |||
| 1fcada4536 | |||
| 1d1cbc83f5 | |||
| 3f21829810 | |||
| 63fe59c7de | |||
| 48517e586c | |||
| ca380ccb93 | |||
| 22cc5ceee2 | |||
| c3b3b95f4a | |||
| 7f1156f9b0 | |||
| b3ba9f5991 | |||
| 9ef79bf710 | |||
| d5f45bffe0 | |||
| b48be75179 | |||
| 2ea91766bb | |||
| 7513a622e3 | |||
| 4bab57968d | |||
| 5e591b89a1 | |||
| 85bfff1083 | |||
| 3f4292b7cc | |||
| 175710126c | |||
| f1d47112d6 | |||
| 30f5464eb1 | |||
| e9b7ec6722 | |||
| 665a709b52 | |||
| 609ea1c8e6 | |||
| 38cb1632bf | |||
| d3ee652860 | |||
| 1f5b8f3bd1 | |||
| 11dca18a2d | |||
| 238d2273b5 | |||
| 761ea9e4c6 | |||
| bcd7d74e61 | |||
| 327cca048b | |||
| d75c3ded0b | |||
| 4540b4a97c | |||
| fce76429b8 | |||
| 7dcce9e1b9 | |||
| 262c3ee24a | |||
| 55c65b21f6 | |||
| 5f81d4a99f | |||
| e92fd1aa5f | |||
| f61cfc720c | |||
| 6850365d7c | |||
| 8d5e2b3a40 | |||
| 21fcbc004e | |||
| d068a3878b | |||
| bf46e40f3a | |||
| 890b2fc396 | |||
| b9cd3bb0bc | |||
| 02541c3146 | |||
| 2b71a22755 | |||
| 16beb6f8ac | |||
| 4e7371317c | |||
| 47e39851ca | |||
| 3321c42d36 | |||
| e7c629b258 | |||
| 660413256f | |||
| 1901359efa | |||
| 7ea0c2f7f8 | |||
| 1bd6d20102 | |||
| 0bd553a078 | |||
| c60523a702 | |||
| befe481a9b | |||
| d6954e1541 | |||
| 6f6b343721 | |||
| 81f0452bc6 | |||
| d2e4989c3c | |||
| 7817d0ec83 | |||
| 723ff26c36 | |||
| a0c3c80ee6 | |||
| a8bf206827 | |||
| a0ef4ba41d | |||
| d3e974f4ea | |||
| 70c1b548ab | |||
| 2223417c91 | |||
| a1328457cf | |||
| 25652669ef | |||
| bcd05ae321 | |||
| f5be376ccc | |||
| 5e2216c414 | |||
| 4a1876eb80 | |||
| 93a3e4cda0 | |||
| 298e688933 | |||
| 745a319baf | |||
| b115434720 | |||
| 47b145f2ec | |||
| b8b0c05035 | |||
| dca4264863 | |||
| 654d527f87 | |||
| d984d12de7 | |||
| 2901145301 | |||
| e23d5c1c45 | |||
| 5936806949 | |||
| 0df9f79d95 | |||
| edddfbc14a | |||
| 21d81a71cc | |||
| b466bb5bbd | |||
| cc887cf2ab | |||
| 0326e42bb3 | |||
| d66904675d | |||
| 7823ab6fc0 | |||
| 9eda6f5dd5 | |||
| 1dc3cd513a | |||
| c870098b82 | |||
| db7922f173 | |||
| 0d1e670ac3 | |||
| 3c2c0a6525 | |||
| eb32dd6eca | |||
| d0e3c69e59 | |||
| 5c52733984 | |||
| 2940d2bd07 | |||
| 4b752834d8 | |||
| ac837f43b9 | |||
| 27cec48408 | |||
| a981959124 | |||
| ee854bb095 | |||
| 0247e91b00 | |||
| 2355c20e92 | |||
| b814567e2b | |||
| 0cb1597801 | |||
| 7e02344a61 | |||
| 1abb2ebe7a | |||
| 37e43501d8 | |||
| da5290a41a | |||
| c64c368d86 | |||
| 4c41d363b7 | |||
| 5a02d3e500 | |||
| f9714ab838 | |||
| 8682a4dffb | |||
| cee8f0186c | |||
| 3530d18d8e | |||
| 7ca9421a69 | |||
| 1206b2c587 | |||
| c8fdd4d583 | |||
| 6e019362c5 | |||
| 75e3fe5b95 | |||
| 11b34c0814 | |||
| 2aa1c38aed | |||
| d04fb9bff3 | |||
| af7522006b | |||
| 50befe4a95 | |||
| 581075796a | |||
| 934705c420 | |||
| ee04671220 | |||
| c069b76f1b | |||
| 981ade6eeb | |||
| 00f9dcdf43 | |||
| 971856a579 | |||
| d0020bad4f | |||
| c3a827d621 | |||
| b70a966aa6 | |||
| cdc80731fb | |||
| b87123ac9b | |||
| d4ac9fb6f4 | |||
| 10105c8b87 | |||
| 7c24c61ab2 | |||
| 890ab510ea | |||
| 3e017b1a89 | |||
| bd17d359d6 | |||
| 60c58fbf17 | |||
| 2fb122c012 | |||
| 6e68af115d | |||
| fef80cd56c | |||
| 6124176b89 | |||
| 11fa5a7a4d | |||
| 954a718197 | |||
| 26eb2f761c | |||
| bc46e954f2 | |||
| 432f3c6b53 | |||
| 7e9a85a5cb | |||
| adc650f399 | |||
| 5bca222339 | |||
| e6cefa584e | |||
| b5096b1c8f | |||
| 690118133d | |||
| 84611a5d29 | |||
| 5def2e51da | |||
| 2d1e422368 | |||
| 82abf5154f | |||
| 526b974c33 | |||
| 320e4e4388 | |||
| acec16e685 | |||
| 42fdc77f5e | |||
| a53dc90171 | |||
| c4f01cd18b | |||
| 0b5b798eb2 | |||
| 2c2a7b608e | |||
| ba8617e4ee | |||
| 701815a5f2 | |||
| d6794e0d75 | |||
| b4e78555d0 | |||
| d9cecc8932 | |||
| 72905b8bfc | |||
| bb1fc4195f | |||
| 2e1fb87361 | |||
| 04d46d1791 | |||
| 76940a9ab5 | |||
| d542773e75 | |||
| f6a35e5fbf | |||
| 96188f83f0 | |||
| 26a2dbac65 | |||
| 58c4e18975 | |||
| e9ec482049 | |||
| bce814b30a | |||
| 1f99df029c | |||
| 92d7ba7ed8 | |||
| 42c6c90366 | |||
| b9530ad5d1 | |||
| 60f574e4b7 | |||
| 0f3e3bf669 | |||
| ad538bb00a | |||
| 421486db18 | |||
| f86977a6fa | |||
| b0f35be17b | |||
| 42829cdad0 | |||
| 94f2f2eace | |||
| e39b7e623c | |||
| 7c34b37786 | |||
| 4415c475f7 | |||
| b7cc1ae964 | |||
| abcf5f06ed | |||
| 566b452b46 |
@@ -0,0 +1,31 @@
|
||||
name: Sync Upstream (12h)
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout fork
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: surf-webkit2
|
||||
|
||||
- name: Add upstream remote
|
||||
run: |
|
||||
git remote add upstream https://git.suckless.org/surf || true
|
||||
git fetch upstream
|
||||
|
||||
- name: Merge upstream into surf-webkit2
|
||||
run: |
|
||||
git config user.name "gitea-runner[bot]"
|
||||
git config user.email "gitea-runner[bot]@noreply.erickahmed.com"
|
||||
git merge upstream/surf-webkit2 --strategy-option ours --no-edit || true
|
||||
|
||||
- name: Push merged branch
|
||||
run: |
|
||||
git push origin surf-webkit2
|
||||
@@ -1,10 +1,10 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
## Surf is starting up slowly. What might happen?
|
||||
## Surf is starting up slowly. What might be causing this?
|
||||
|
||||
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
|
||||
The first suspect for such behaviour is the plugin handling. Run surf on
|
||||
the commandline and see if there are errors because of “nspluginwrapper”
|
||||
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,8 +1,41 @@
|
||||
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>
|
||||
© 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-2021 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-2017 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>
|
||||
© 2017 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
© 2017 ssd <ssd@mailless.org>
|
||||
© 2017 Constantine Bytensky <kostya3@gmail.com>
|
||||
© 2017 Eon S. Jeon <esjeon@hyunmu.am>
|
||||
© 2017 Jochen Sprickerhof <git@jochen.sprickerhof.de>
|
||||
© 2018 nzl <uruabi@gmail.com>
|
||||
© 2018 Eddie Thieda <eddie.thieda@gmail.com>
|
||||
© 2018 Leonardo Taccari <iamleot@gmail.com>
|
||||
© 2019 efe <efe@efe.kim>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
|
||||
@@ -1,61 +1,76 @@
|
||||
# surf - simple browser
|
||||
# See LICENSE file for copyright and license details.
|
||||
.POSIX:
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = surf.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
WSRC = webext-surf.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
WOBJ = $(WSRC:.c=.o)
|
||||
WLIB = $(WSRC:.c=.so)
|
||||
|
||||
all: options surf
|
||||
all: options surf $(WLIB)
|
||||
|
||||
options:
|
||||
@echo surf build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
@echo "CC = $(CC)"
|
||||
@echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)"
|
||||
@echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)"
|
||||
@echo "LDFLAGS = $(LDFLAGS)"
|
||||
|
||||
.c.o:
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
surf: $(OBJ)
|
||||
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
$(OBJ) $(WOBJ): config.h common.h config.mk
|
||||
|
||||
config.h:
|
||||
@echo creating $@ from config.def.h
|
||||
@cp config.def.h $@
|
||||
cp config.def.h $@
|
||||
|
||||
surf: ${OBJ}
|
||||
@echo CC -o $@
|
||||
@${CC} -o $@ surf.o ${LDFLAGS}
|
||||
$(OBJ): $(SRC)
|
||||
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $(SRC)
|
||||
|
||||
$(WLIB): $(WOBJ)
|
||||
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $? $(WEBEXTLIBS)
|
||||
|
||||
$(WOBJ): $(WSRC)
|
||||
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WSRC)
|
||||
|
||||
clean:
|
||||
@echo cleaning
|
||||
@rm -f surf ${OBJ} surf-${VERSION}.tar.gz
|
||||
rm -f surf $(OBJ)
|
||||
rm -f $(WLIB) $(WOBJ)
|
||||
|
||||
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
|
||||
@rm -rf surf-${VERSION}
|
||||
distclean: clean
|
||||
rm -f config.h surf-$(VERSION).tar.gz
|
||||
|
||||
dist: distclean
|
||||
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 common.h $(SRC) $(WSRC) surf-$(VERSION)
|
||||
tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
||||
gzip surf-$(VERSION).tar
|
||||
rm -rf surf-$(VERSION)
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@cp -f surf ${DESTDIR}${PREFIX}/bin
|
||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/surf
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@sed "s/VERSION/${VERSION}/g" < surf.1 > ${DESTDIR}${MANPREFIX}/man1/surf.1
|
||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/surf.1
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f surf $(DESTDIR)$(PREFIX)/bin
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
|
||||
mkdir -p $(DESTDIR)$(LIBDIR)
|
||||
cp -f $(WLIB) $(DESTDIR)$(LIBDIR)
|
||||
for wlib in $(WLIB); do \
|
||||
chmod 644 $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||
done
|
||||
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
||||
sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/surf
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/surf.1
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||
for wlib in $(WLIB); do \
|
||||
rm -f $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||
done
|
||||
- rmdir $(DESTDIR)$(LIBDIR)
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
||||
.PHONY: all options distclean clean dist install uninstall
|
||||
|
||||
@@ -3,39 +3,46 @@
|
||||
* by 20h
|
||||
*/
|
||||
|
||||
#ifndef __ARG_H__
|
||||
#define __ARG_H__
|
||||
#ifndef ARG_H__
|
||||
#define ARG_H__
|
||||
|
||||
extern char *argv0;
|
||||
|
||||
#define USED(x) ((void)(x))
|
||||
|
||||
/* use main(int argc, char *argv[]) */
|
||||
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||
argv[0] && argv[0][1]\
|
||||
&& argv[0][0] == '-';\
|
||||
argv[0] && argv[0][0] == '-'\
|
||||
&& argv[0][1];\
|
||||
argc--, argv++) {\
|
||||
char _argc;\
|
||||
char **_argv;\
|
||||
char argc_;\
|
||||
char **argv_;\
|
||||
int brk_;\
|
||||
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||
argv++;\
|
||||
argc--;\
|
||||
break;\
|
||||
}\
|
||||
for (argv[0]++, _argv = argv; argv[0][0];\
|
||||
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||
argv[0][0] && !brk_;\
|
||||
argv[0]++) {\
|
||||
if (_argv != argv)\
|
||||
if (argv_ != argv)\
|
||||
break;\
|
||||
_argc = argv[0][0];\
|
||||
switch (_argc)
|
||||
|
||||
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]))
|
||||
#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
|
||||
|
||||
|
||||
+145
-92
@@ -1,58 +1,88 @@
|
||||
/* modifier 0 means no modifier */
|
||||
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 int surfuseragent = 1; /* Append Surf version to default WebKit user agent */
|
||||
static char *fulluseragent = ""; /* Or override the whole user agent string */
|
||||
static char *scriptfile = "~/.surf/script.js";
|
||||
static char *styledir = "~/.surf/styles/";
|
||||
static char *cachefolder = "~/.surf/cache/";
|
||||
|
||||
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 *certdir = "~/.surf/certificates/";
|
||||
static char *cachedir = "~/.surf/cache/";
|
||||
static char *cookiefile = "~/.surf/cookies.txt";
|
||||
static char *cookiepolicies = "Aa@"; /* A: accept all; a: accept nothing,
|
||||
* @: accept no 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;
|
||||
/* Highest priority value will be used.
|
||||
* Default parameters are priority 0
|
||||
* Per-uri parameters are priority 1
|
||||
* Command parameters are priority 2
|
||||
*/
|
||||
static Parameter defconfig[ParameterLast] = {
|
||||
/* parameter Arg value priority */
|
||||
[AccessMicrophone] = { { .i = 0 }, },
|
||||
[AccessWebcam] = { { .i = 0 }, },
|
||||
[Certificate] = { { .i = 0 }, },
|
||||
[CaretBrowsing] = { { .i = 0 }, },
|
||||
[CookiePolicies] = { { .v = "@Aa" }, },
|
||||
[DarkMode] = { { .i = 0 }, },
|
||||
[DefaultCharset] = { { .v = "UTF-8" }, },
|
||||
[DiskCache] = { { .i = 1 }, },
|
||||
[DNSPrefetch] = { { .i = 0 }, },
|
||||
[Ephemeral] = { { .i = 0 }, },
|
||||
[FileURLsCrossAccess] = { { .i = 0 }, },
|
||||
[FontSize] = { { .i = 12 }, },
|
||||
[Geolocation] = { { .i = 0 }, },
|
||||
[HideBackground] = { { .i = 0 }, },
|
||||
[Inspector] = { { .i = 0 }, },
|
||||
[JavaScript] = { { .i = 1 }, },
|
||||
[KioskMode] = { { .i = 0 }, },
|
||||
[LoadImages] = { { .i = 1 }, },
|
||||
[MediaManualPlay] = { { .i = 1 }, },
|
||||
[PDFJSviewer] = { { .i = 1 }, },
|
||||
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
|
||||
[RunInFullscreen] = { { .i = 0 }, },
|
||||
[ScrollBars] = { { .i = 1 }, },
|
||||
[ShowIndicators] = { { .i = 1 }, },
|
||||
[SiteQuirks] = { { .i = 1 }, },
|
||||
[SmoothScrolling] = { { .i = 0 }, },
|
||||
[SpellChecking] = { { .i = 0 }, },
|
||||
[SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, },
|
||||
[StrictTLS] = { { .i = 1 }, },
|
||||
[Style] = { { .i = 1 }, },
|
||||
[WebGL] = { { .i = 0 }, },
|
||||
[ZoomLevel] = { { .f = 1.0 }, },
|
||||
};
|
||||
|
||||
#define SETPROP(p, q) { \
|
||||
.v = (char *[]){ "/bin/sh", "-c", \
|
||||
"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 \
|
||||
} \
|
||||
static UriParameters uriparams[] = {
|
||||
{ "(://|\\.)suckless\\.org(/|$)", {
|
||||
[JavaScript] = { { .i = 0 }, 1 },
|
||||
}, },
|
||||
};
|
||||
|
||||
/* default window size: width, height */
|
||||
static int winsize[] = { 800, 600 };
|
||||
|
||||
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
||||
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
|
||||
|
||||
#define PROMPT_GO "Go:"
|
||||
#define PROMPT_FIND "Find:"
|
||||
|
||||
/* SETPROP(readprop, setprop, prompt)*/
|
||||
#define SETPROP(r, s, p) { \
|
||||
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||
"prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \
|
||||
"| sed -e 's/^"r"(UTF8_STRING) = \"\\(.*\\)\"/\\1/' " \
|
||||
" -e 's/\\\\\\(.\\)/\\1/g')\" " \
|
||||
"| dmenu -p '"p"' -w $1)\" " \
|
||||
"&& xprop -id $1 -f "s" 8u -set "s" \"$prop\"", \
|
||||
"surf-setprop", winid, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* DOWNLOAD(URI, referer) */
|
||||
#define DOWNLOAD(d, r) { \
|
||||
.v = (char *[]){ "/bin/sh", "-c", \
|
||||
"st -e /bin/sh -c \"curl -L -J -O --user-agent '$1'" \
|
||||
" --referer '$2' -b $3 -c $3 '$0';" \
|
||||
" sleep 5;\"", \
|
||||
d, useragent, r, cookiefile, NULL \
|
||||
} \
|
||||
#define DOWNLOAD(u, r) { \
|
||||
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
|
||||
"curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \
|
||||
" -e \"$3\" \"$4\"; read", \
|
||||
"surf-download", useragent, cookiefile, r, u, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* PLUMB(URI) */
|
||||
@@ -60,9 +90,16 @@ static Bool allowgeolocation = TRUE;
|
||||
* "http://" or "https://" should be opened.
|
||||
*/
|
||||
#define PLUMB(u) {\
|
||||
.v = (char *[]){ "/bin/sh", "-c", \
|
||||
"xdg-open \"$0\"", u, NULL \
|
||||
} \
|
||||
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||
"xdg-open \"$0\"", u, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* VIDEOPLAY(URI) */
|
||||
#define VIDEOPLAY(u) {\
|
||||
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||
"mpv --really-quiet \"$0\"", u, NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
/* styles */
|
||||
@@ -70,11 +107,20 @@ static Bool allowgeolocation = TRUE;
|
||||
* The iteration will stop at the first match, beginning at the beginning of
|
||||
* the list.
|
||||
*/
|
||||
static SiteStyle styles[] = {
|
||||
static SiteSpecific styles[] = {
|
||||
/* regexp file in $styledir */
|
||||
{ ".*", "default.css" },
|
||||
};
|
||||
|
||||
/* certificates */
|
||||
/*
|
||||
* Provide custom certificate for urls
|
||||
*/
|
||||
static SiteSpecific certs[] = {
|
||||
/* regexp file in $certdir */
|
||||
{ "://suckless\\.org/", "suckless.org.crt" },
|
||||
};
|
||||
|
||||
#define MODKEY GDK_CONTROL_MASK
|
||||
|
||||
/* hotkeys */
|
||||
@@ -83,59 +129,66 @@ static SiteStyle styles[] = {
|
||||
* 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 } },
|
||||
/* modifier keyval function arg */
|
||||
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
|
||||
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||
|
||||
{ MODKEY, GDK_p, clipboard, { .b = TRUE } },
|
||||
{ MODKEY, GDK_y, clipboard, { .b = FALSE } },
|
||||
{ 0, GDK_KEY_Escape, stop, { 0 } },
|
||||
{ MODKEY, GDK_KEY_c, stop, { 0 } },
|
||||
|
||||
{ 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_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
|
||||
{ MODKEY, GDK_KEY_r, reload, { .i = 0 } },
|
||||
|
||||
{ MODKEY, GDK_l, navigate, { .i = +1 } },
|
||||
{ MODKEY, GDK_h, navigate, { .i = -1 } },
|
||||
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
|
||||
{ MODKEY, GDK_KEY_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 } },
|
||||
/* vertical and horizontal scrolling, in viewport percentage */
|
||||
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
|
||||
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
|
||||
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
|
||||
{ MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
|
||||
{ MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
|
||||
{ MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
|
||||
|
||||
{ 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_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
|
||||
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
|
||||
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
|
||||
|
||||
{ MODKEY, GDK_n, find, { .b = TRUE } },
|
||||
{ MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } },
|
||||
{ MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
|
||||
{ MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
|
||||
|
||||
{ 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_KEY_n, find, { .i = +1 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
|
||||
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
|
||||
{ MODKEY, GDK_KEY_t, showcert, { 0 } },
|
||||
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
|
||||
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } },
|
||||
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
|
||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */
|
||||
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
|
||||
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 } },
|
||||
/* target event mask button function argument stop event */
|
||||
{ OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
|
||||
{ OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
|
||||
{ OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
|
||||
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
|
||||
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
||||
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
||||
};
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
# surf version
|
||||
VERSION = 0.6
|
||||
VERSION = 2.1
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = ${PREFIX}/share/man
|
||||
PREFIX = /usr
|
||||
MANPREFIX = $(PREFIX)/share/man
|
||||
LIBPREFIX = $(PREFIX)/lib
|
||||
LIBDIR = $(LIBPREFIX)/surf
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
X11INC = `pkg-config --cflags x11`
|
||||
X11LIB = `pkg-config --libs x11`
|
||||
|
||||
GTKINC = `pkg-config --cflags gtk+-2.0 webkit-1.0`
|
||||
GTKLIB = `pkg-config --libs gtk+-2.0 webkit-1.0`
|
||||
GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||
GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||
WEBEXTINC = `pkg-config --cflags webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||
WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||
|
||||
# includes and libs
|
||||
INCS = -I. -I/usr/include -I${X11INC} ${GTKINC}
|
||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0
|
||||
INCS = $(X11INC) $(GTKINC)
|
||||
LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = -g ${LIBS}
|
||||
CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
|
||||
-DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
|
||||
-D_DEFAULT_SOURCE
|
||||
SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS)
|
||||
WEBEXTCFLAGS = -fPIC $(WEBEXTINC)
|
||||
|
||||
# Solaris
|
||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||
#LDFLAGS = ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
||||
# compiler
|
||||
#CC = c99
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
surf \- simple webkit-based browser
|
||||
.SH SYNOPSIS
|
||||
.B surf
|
||||
.RB [-bBdDfFgGiIkKmMnNpPsSvx]
|
||||
.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX]
|
||||
.RB [-a\ cookiepolicies]
|
||||
.RB [-c\ cookiefile]
|
||||
.RB [-C\ stylefile]
|
||||
.RB [-e\ xid]
|
||||
.RB [-r\ scriptfile]
|
||||
.RB [-t\ stylefile]
|
||||
.RB [-u\ useragent]
|
||||
.RB [-z\ zoomlevel]
|
||||
.RB "URI"
|
||||
.RB [URI]
|
||||
.SH DESCRIPTION
|
||||
surf is a simple Web browser based on WebKit/GTK+. It is able
|
||||
to display websites and follow links. It supports the XEmbed protocol
|
||||
@@ -21,25 +21,30 @@ one can point surf to another URI by setting its XProperties.
|
||||
.TP
|
||||
.B \-a cookiepolicies
|
||||
Define the order of
|
||||
.I cookie policies.
|
||||
The default is "Aa@" but could be
|
||||
.I cookie policies\fR.
|
||||
The default is "@Aa" but could be
|
||||
redefined in the
|
||||
.I config.h,
|
||||
.IR 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
|
||||
Disable Scrollbars.
|
||||
.TP
|
||||
.B \-B
|
||||
Enable Scrollbars
|
||||
Enable Scrollbars.
|
||||
.TP
|
||||
.B \-c cookiefile
|
||||
.B \-c cookiefile
|
||||
Specify the
|
||||
.I cookiefile
|
||||
to use.
|
||||
.TP
|
||||
.B \-C stylefile
|
||||
Specify the user
|
||||
.IR stylefile .
|
||||
This does disable the site-specific styles.
|
||||
.TP
|
||||
.B \-d
|
||||
Disable the disk cache.
|
||||
.TP
|
||||
@@ -48,7 +53,7 @@ Enable the disk cache.
|
||||
.TP
|
||||
.B \-e xid
|
||||
Reparents to window specified by
|
||||
.I xid.
|
||||
.IR xid .
|
||||
.TP
|
||||
.B \-f
|
||||
Start surf in windowed mode (not fullscreen).
|
||||
@@ -63,16 +68,16 @@ Disable giving the geolocation to websites.
|
||||
Enable giving the geolocation to websites.
|
||||
.TP
|
||||
.B \-i
|
||||
Disable Images
|
||||
Disable Images.
|
||||
.TP
|
||||
.B \-I
|
||||
Enable Images
|
||||
Enable Images.
|
||||
.TP
|
||||
.B \-k
|
||||
Disable kiosk mode (disable key strokes and right click)
|
||||
Disable kiosk mode (enable key strokes and right click).
|
||||
.TP
|
||||
.B \-K
|
||||
Enable kiosk mode (disable key strokes and right click)
|
||||
Enable kiosk mode (disable key strokes and right click).
|
||||
.TP
|
||||
.B \-m
|
||||
Disable application of user style sheets.
|
||||
@@ -86,28 +91,23 @@ Disable the Web Inspector (Developer Tools).
|
||||
.B \-N
|
||||
Enable the Web Inspector (Developer Tools).
|
||||
.TP
|
||||
.B \-p
|
||||
Disable Plugins
|
||||
.TP
|
||||
.B \-P
|
||||
Enable Plugins
|
||||
.TP
|
||||
.B \-r scriptfile
|
||||
.B \-r scriptfile
|
||||
Specify the user
|
||||
.I scriptfile.
|
||||
.IR scriptfile .
|
||||
.TP
|
||||
.B \-s
|
||||
Disable Javascript
|
||||
Disable Javascript.
|
||||
.TP
|
||||
.B \-S
|
||||
Enable Javascript
|
||||
Enable Javascript.
|
||||
.TP
|
||||
.B \-t stylefile
|
||||
Specify the user
|
||||
.I stylefile.
|
||||
This does disable the site-specific styles.
|
||||
.B \-t
|
||||
Disable strict TLS check.
|
||||
.TP
|
||||
.B \-u useragent
|
||||
.B \-T
|
||||
Enable strict TLS check.
|
||||
.TP
|
||||
.B \-u useragent
|
||||
Specify the
|
||||
.I useragent
|
||||
which surf should use.
|
||||
@@ -115,16 +115,21 @@ which surf should use.
|
||||
.B \-v
|
||||
Prints version information to standard output, then exits.
|
||||
.TP
|
||||
.B \-x
|
||||
.B \-w
|
||||
Prints xid to standard output. This can be used to script the browser in for
|
||||
example
|
||||
.BR xdotool(1).
|
||||
.BR xdotool(1) .
|
||||
.TP
|
||||
.B \-z zoomlevel
|
||||
.B -x
|
||||
Disable custom certificates.
|
||||
.TP
|
||||
.B -X
|
||||
Enable custom certificates.
|
||||
.TP
|
||||
.B \-z zoomlevel
|
||||
Specify the
|
||||
.I zoomlevel
|
||||
which surf should use.
|
||||
.BR xprop(1).
|
||||
.SH USAGE
|
||||
.B Escape
|
||||
Stops loading current page or stops download.
|
||||
@@ -157,10 +162,10 @@ Scroll horizontally to the left.
|
||||
Zooms page in.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-j or Ctrl\--
|
||||
Zooms page out
|
||||
Zooms page out.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-q
|
||||
Resets Zoom
|
||||
Resets Zoom.
|
||||
.TP
|
||||
.B Ctrl\-f and Ctrl\-/
|
||||
Opens the search-bar.
|
||||
@@ -189,12 +194,12 @@ Reloads the website without using the cache.
|
||||
.B Ctrl\-y
|
||||
Copies current URI to primary selection.
|
||||
.TP
|
||||
.B Ctrl\-o
|
||||
Show the sourcecode of the current page.
|
||||
.B Ctrl\-t
|
||||
Display the current TLS certificate in a popup window.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-a
|
||||
Toggle through the the
|
||||
.I cookie policies.
|
||||
.I cookie policies\fR.
|
||||
This will not reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-b
|
||||
@@ -203,12 +208,15 @@ Toggle scrollbars. This will reload the page.
|
||||
.B Ctrl\-Shift\-c
|
||||
Toggle caret browsing. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-d
|
||||
Toggle dark mode.
|
||||
.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
|
||||
.I stylefile
|
||||
file should be loaded. This will reload the page.
|
||||
.TP
|
||||
.B Ctrl\-Shift\-o
|
||||
@@ -217,15 +225,14 @@ Open the Web Inspector (Developer Tools) window for the current page.
|
||||
.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.
|
||||
.B Ctrl\-Shift\-t
|
||||
Toggle strict TLS check. This will reload the page.
|
||||
.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 otherwsie specified, a lower case letter means disabled and an upper case letter means enabled.
|
||||
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
|
||||
@@ -251,11 +258,14 @@ images
|
||||
.B s S
|
||||
scripts
|
||||
.TP
|
||||
.B v V
|
||||
plugins
|
||||
.TP
|
||||
.B m M
|
||||
styles
|
||||
.TP
|
||||
.B x X
|
||||
custom certificates
|
||||
.TP
|
||||
.B t T
|
||||
strict TLS
|
||||
.SH INDICATORS OF WEB PAGE
|
||||
The second part of the indicators specifies modes of the web page itself.
|
||||
.SS First character: encryption
|
||||
@@ -264,7 +274,7 @@ The second part of the indicators specifies modes of the web page itself.
|
||||
unencrypted
|
||||
.TP
|
||||
.B T
|
||||
encrypted (SSL)
|
||||
encrypted (TLS)
|
||||
.TP
|
||||
.B U
|
||||
attempted encryption but failed
|
||||
@@ -279,26 +289,17 @@ using proxy
|
||||
.B SURF_USERAGENT
|
||||
If this variable is set upon startup, surf will use it as the
|
||||
.I useragent
|
||||
string
|
||||
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.
|
||||
If this variable is set and not empty upon startup, surf will use it as the http proxy.
|
||||
.SH SIGNALS
|
||||
Surf will reload the current page on
|
||||
.BR SIGHUP .
|
||||
.SH SEE ALSO
|
||||
.BR dmenu(1),
|
||||
.BR xprop(1),
|
||||
.BR tabbed(1),
|
||||
.BR nspluginwrapper(1),
|
||||
.BR xdotool(1)
|
||||
.SH BUGS
|
||||
Please report them!
|
||||
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <gio/gunixfdlist.h>
|
||||
#include <webkit2/webkit-web-extension.h>
|
||||
#include <webkitdom/webkitdom.h>
|
||||
#include <webkitdom/WebKitDOMDOMWindowUnstable.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#define LENGTH(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
static WebKitWebExtension *webext;
|
||||
static int sock;
|
||||
|
||||
/*
|
||||
* Return:
|
||||
* 0 No data processed: need more data
|
||||
* > 0 Amount of data processed or discarded
|
||||
*/
|
||||
static size_t
|
||||
evalmsg(char *msg, size_t sz)
|
||||
{
|
||||
char js[48];
|
||||
WebKitWebPage *page;
|
||||
JSCContext *jsc;
|
||||
JSCValue *jsv;
|
||||
|
||||
if (!(page = webkit_web_extension_get_page(webext, msg[0])))
|
||||
return sz;
|
||||
|
||||
if (sz < 2)
|
||||
return 0;
|
||||
|
||||
jsc = webkit_frame_get_js_context(webkit_web_page_get_main_frame(page));
|
||||
jsv = NULL;
|
||||
|
||||
switch (msg[1]) {
|
||||
case 'h':
|
||||
if (sz < 3) {
|
||||
sz = 0;
|
||||
break;
|
||||
}
|
||||
sz = 3;
|
||||
snprintf(js, sizeof(js),
|
||||
"window.scrollBy(window.innerWidth/100*%hhd,0);",
|
||||
msg[2]);
|
||||
jsv = jsc_context_evaluate(jsc, js, -1);
|
||||
break;
|
||||
case 'v':
|
||||
if (sz < 3) {
|
||||
sz = 0;
|
||||
break;
|
||||
}
|
||||
sz = 3;
|
||||
snprintf(js, sizeof(js),
|
||||
"window.scrollBy(0,window.innerHeight/100*%hhd);",
|
||||
msg[2]);
|
||||
jsv = jsc_context_evaluate(jsc, js, -1);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "%s:%d:evalmsg: unknown cmd(%zu): '%#x'\n",
|
||||
__FILE__, __LINE__, sz, msg[1]);
|
||||
}
|
||||
|
||||
g_object_unref(jsc);
|
||||
if (jsv)
|
||||
g_object_unref(jsv);
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
readsock(GIOChannel *s, GIOCondition c, gpointer unused)
|
||||
{
|
||||
static char msg[MSGBUFSZ];
|
||||
static size_t msgoff;
|
||||
GError *gerr = NULL;
|
||||
size_t sz;
|
||||
gsize rsz;
|
||||
|
||||
if (g_io_channel_read_chars(s, msg+msgoff, sizeof(msg)-msgoff, &rsz, &gerr) !=
|
||||
G_IO_STATUS_NORMAL) {
|
||||
if (gerr) {
|
||||
fprintf(stderr, "webext: error reading socket: %s\n",
|
||||
gerr->message);
|
||||
g_error_free(gerr);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (msgoff >= sizeof(msg)) {
|
||||
fprintf(stderr, "%s:%d:%s: msgoff: %zu", __FILE__, __LINE__, __func__, msgoff);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (rsz += msgoff; rsz; rsz -= sz) {
|
||||
sz = evalmsg(msg, rsz);
|
||||
if (sz == 0) {
|
||||
/* need more data */
|
||||
break;
|
||||
}
|
||||
if (sz != rsz) {
|
||||
/* continue processing message */
|
||||
memmove(msg, msg+sz, rsz-sz);
|
||||
}
|
||||
}
|
||||
msgoff = rsz;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
pageusermessagereply(GObject *o, GAsyncResult *r, gpointer page)
|
||||
{
|
||||
WebKitUserMessage *m;
|
||||
GUnixFDList *gfd;
|
||||
GIOChannel *gchansock;
|
||||
const char *name;
|
||||
int nfd;
|
||||
|
||||
m = webkit_web_page_send_message_to_view_finish(page, r, NULL);
|
||||
name = webkit_user_message_get_name(m);
|
||||
if (strcmp(name, "surf-pipe") != 0) {
|
||||
fprintf(stderr, "webext-surf: Unknown User Reply: %s\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
gfd = webkit_user_message_get_fd_list(m);
|
||||
if ((nfd = g_unix_fd_list_get_length(gfd)) != 1) {
|
||||
fprintf(stderr, "webext-surf: Too many file-descriptors: %d\n", nfd);
|
||||
return;
|
||||
}
|
||||
|
||||
sock = g_unix_fd_list_get(gfd, 0, NULL);
|
||||
|
||||
gchansock = g_io_channel_unix_new(sock);
|
||||
g_io_channel_set_encoding(gchansock, NULL, NULL);
|
||||
g_io_channel_set_flags(gchansock, g_io_channel_get_flags(gchansock)
|
||||
| G_IO_FLAG_NONBLOCK, NULL);
|
||||
g_io_channel_set_close_on_unref(gchansock, TRUE);
|
||||
g_io_add_watch(gchansock, G_IO_IN, readsock, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
pagecreated(WebKitWebExtension *e, WebKitWebPage *p, gpointer unused)
|
||||
{
|
||||
WebKitUserMessage *msg;
|
||||
|
||||
msg = webkit_user_message_new("page-created", NULL);
|
||||
webkit_web_page_send_message_to_view(p, msg, NULL, pageusermessagereply, p);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
webkit_web_extension_initialize(WebKitWebExtension *e)
|
||||
{
|
||||
webext = e;
|
||||
|
||||
g_signal_connect(G_OBJECT(e), "page-created",
|
||||
G_CALLBACK(pagecreated), NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user