Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -1,10 +1,10 @@
|
|||||||
# Frequently Asked Questions
|
# 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
|
The first suspect for such behaviour is the plugin handling. Run surf on
|
||||||
on the commandline and see if there are errors because of »nspluginwrap‐
|
the commandline and see if there are errors because of “nspluginwrapper”
|
||||||
per« or failed RPCs to them. If that is true, go to ~/.mozilla/plugins
|
or failed RPCs to them. If that is true, go to ~/.mozilla/plugins and
|
||||||
and try removing stale links to plugins not on your system anymore. This
|
try removing stale links to plugins not on your system anymore. This
|
||||||
will stop surf from trying to load them.
|
will stop surf from trying to load them.
|
||||||
|
|
||||||
|
|||||||
@@ -1,61 +1,76 @@
|
|||||||
# surf - simple browser
|
# surf - simple browser
|
||||||
# See LICENSE file for copyright and license details.
|
# See LICENSE file for copyright and license details.
|
||||||
|
.POSIX:
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
SRC = surf.c
|
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:
|
options:
|
||||||
@echo surf build options:
|
@echo surf build options:
|
||||||
@echo "CFLAGS = ${CFLAGS}"
|
@echo "CC = $(CC)"
|
||||||
@echo "LDFLAGS = ${LDFLAGS}"
|
@echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)"
|
||||||
@echo "CC = ${CC}"
|
@echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)"
|
||||||
|
@echo "LDFLAGS = $(LDFLAGS)"
|
||||||
|
|
||||||
.c.o:
|
surf: $(OBJ)
|
||||||
@echo CC $<
|
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||||
@${CC} -c ${CFLAGS} $<
|
|
||||||
|
|
||||||
${OBJ}: config.h config.mk
|
$(OBJ) $(WOBJ): config.h common.h config.mk
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
@echo creating $@ from config.def.h
|
cp config.def.h $@
|
||||||
@cp config.def.h $@
|
|
||||||
|
|
||||||
surf: ${OBJ}
|
$(OBJ): $(SRC)
|
||||||
@echo CC -o $@
|
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $(SRC)
|
||||||
@${CC} -o $@ surf.o ${LDFLAGS}
|
|
||||||
|
$(WLIB): $(WOBJ)
|
||||||
|
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $? $(WEBEXTLIBS)
|
||||||
|
|
||||||
|
$(WOBJ): $(WSRC)
|
||||||
|
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WSRC)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo cleaning
|
rm -f surf $(OBJ)
|
||||||
@rm -f surf ${OBJ} surf-${VERSION}.tar.gz
|
rm -f $(WLIB) $(WOBJ)
|
||||||
|
|
||||||
dist: clean
|
distclean: clean
|
||||||
@echo creating dist tarball
|
rm -f config.h surf-$(VERSION).tar.gz
|
||||||
@mkdir -p surf-${VERSION}
|
|
||||||
@cp -R LICENSE Makefile config.mk config.def.h README \
|
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-open.sh arg.h TODO.md surf.png \
|
||||||
surf.1 ${SRC} surf-${VERSION}
|
surf.1 $(SRC) $(CSRC) $(WSRC) surf-$(VERSION)
|
||||||
@tar -cf surf-${VERSION}.tar surf-${VERSION}
|
tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
||||||
@gzip surf-${VERSION}.tar
|
gzip surf-$(VERSION).tar
|
||||||
@rm -rf surf-${VERSION}
|
rm -rf surf-$(VERSION)
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
cp -f surf $(DESTDIR)$(PREFIX)/bin
|
||||||
@cp -f surf ${DESTDIR}${PREFIX}/bin
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
|
||||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/surf
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
||||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
cp -f $(WLIB) $(DESTDIR)$(LIBDIR)
|
||||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
for wlib in $(WLIB); do \
|
||||||
@sed "s/VERSION/${VERSION}/g" < surf.1 > ${DESTDIR}${MANPREFIX}/man1/surf.1
|
chmod 644 $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/surf.1
|
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:
|
uninstall:
|
||||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
||||||
@rm -f ${DESTDIR}${PREFIX}/bin/surf
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
for wlib in $(WLIB); do \
|
||||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/surf.1
|
rm -f $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||||
|
done
|
||||||
|
- rmdir $(DESTDIR)$(LIBDIR)
|
||||||
|
|
||||||
.PHONY: all options clean dist install uninstall
|
.PHONY: all options distclean clean dist install uninstall
|
||||||
|
|||||||
+86
-60
@@ -3,65 +3,83 @@ static int surfuseragent = 1; /* Append Surf version to default WebKit user
|
|||||||
static char *fulluseragent = ""; /* Or override the whole user agent string */
|
static char *fulluseragent = ""; /* Or override the whole user agent string */
|
||||||
static char *scriptfile = "~/.surf/script.js";
|
static char *scriptfile = "~/.surf/script.js";
|
||||||
static char *styledir = "~/.surf/styles/";
|
static char *styledir = "~/.surf/styles/";
|
||||||
|
static char *certdir = "~/.surf/certificates/";
|
||||||
static char *cachedir = "~/.surf/cache/";
|
static char *cachedir = "~/.surf/cache/";
|
||||||
static char *cookiefile = "~/.surf/cookies.txt";
|
static char *cookiefile = "~/.surf/cookies.txt";
|
||||||
|
|
||||||
/* Webkit default features */
|
/* Webkit default features */
|
||||||
|
/* 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] = {
|
static Parameter defconfig[ParameterLast] = {
|
||||||
SETB(AcceleratedCanvas, 1),
|
/* parameter Arg value priority */
|
||||||
SETB(CaretBrowsing, 0),
|
[AccessMicrophone] = { { .i = 0 }, },
|
||||||
SETV(CookiePolicies, "@Aa"),
|
[AccessWebcam] = { { .i = 0 }, },
|
||||||
SETB(DiskCache, 1),
|
[Certificate] = { { .i = 0 }, },
|
||||||
SETB(DNSPrefetch, 0),
|
[CaretBrowsing] = { { .i = 0 }, },
|
||||||
SETI(FontSize, 12),
|
[CookiePolicies] = { { .v = "@Aa" }, },
|
||||||
SETB(FrameFlattening, 0),
|
[DefaultCharset] = { { .v = "UTF-8" }, },
|
||||||
SETB(Geolocation, 0),
|
[DiskCache] = { { .i = 1 }, },
|
||||||
SETB(HideBackground, 0),
|
[DNSPrefetch] = { { .i = 0 }, },
|
||||||
SETB(Inspector, 0),
|
[Ephemeral] = { { .i = 0 }, },
|
||||||
SETB(JavaScript, 1),
|
[FileURLsCrossAccess] = { { .i = 0 }, },
|
||||||
SETB(KioskMode, 0),
|
[FontSize] = { { .i = 12 }, },
|
||||||
SETB(LoadImages, 1),
|
[FrameFlattening] = { { .i = 0 }, },
|
||||||
SETB(MediaManualPlay, 0),
|
[Geolocation] = { { .i = 0 }, },
|
||||||
SETB(Plugins, 1),
|
[HideBackground] = { { .i = 0 }, },
|
||||||
SETV(PreferredLanguages, ((char *[]){ NULL })),
|
[Inspector] = { { .i = 0 }, },
|
||||||
SETB(RunInFullscreen, 0),
|
[Java] = { { .i = 1 }, },
|
||||||
SETB(ScrollBars, 1),
|
[JavaScript] = { { .i = 1 }, },
|
||||||
SETB(ShowIndicators, 1),
|
[KioskMode] = { { .i = 0 }, },
|
||||||
SETB(SiteQuirks, 1),
|
[LoadImages] = { { .i = 1 }, },
|
||||||
SETB(SpellChecking, 0),
|
[MediaManualPlay] = { { .i = 1 }, },
|
||||||
SETV(SpellLanguages, ((char *[]){ "en_US", NULL })),
|
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
|
||||||
SETB(StrictSSL, 0),
|
[RunInFullscreen] = { { .i = 0 }, },
|
||||||
SETB(Style, 1),
|
[ScrollBars] = { { .i = 1 }, },
|
||||||
SETF(ZoomLevel, 1.0),
|
[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 }, },
|
||||||
};
|
};
|
||||||
|
|
||||||
static UriParameters uriparams[] = {
|
static UriParameters uriparams[] = {
|
||||||
{ "(://|\\.)suckless\\.org(/|$)", {
|
{ "(://|\\.)suckless\\.org(/|$)", {
|
||||||
FSETB(JavaScript, 0),
|
[JavaScript] = { { .i = 0 }, 1 },
|
||||||
FSETB(Plugins, 0),
|
|
||||||
}, },
|
}, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* default window size: width, height */
|
||||||
|
static int winsize[] = { 800, 600 };
|
||||||
|
|
||||||
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
||||||
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
|
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
|
||||||
|
|
||||||
#define SETPROP(p, q) { \
|
#define PROMPT_GO "Go:"
|
||||||
|
#define PROMPT_FIND "Find:"
|
||||||
|
|
||||||
|
/* SETPROP(readprop, setprop, prompt)*/
|
||||||
|
#define SETPROP(r, s, p) { \
|
||||||
.v = (const char *[]){ "/bin/sh", "-c", \
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
"prop=\"`xprop -id $2 $0 " \
|
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
|
||||||
"| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \
|
"| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
|
||||||
"| xargs -0 printf %b | dmenu`\" &&" \
|
"| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
|
||||||
"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
|
"surf-setprop", winid, r, s, p, NULL \
|
||||||
p, q, winid, NULL \
|
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DOWNLOAD(URI, referer) */
|
/* DOWNLOAD(URI, referer) */
|
||||||
#define DOWNLOAD(d, r) { \
|
#define DOWNLOAD(u, r) { \
|
||||||
.v = (const char *[]){ "/bin/sh", "-c", \
|
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
|
||||||
"st -e /bin/sh -c \"curl -g -L -J -O --user-agent '$1'" \
|
"curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \
|
||||||
" --referer '$2' -b $3 -c $3 '$0';" \
|
" -e \"$3\" \"$4\"; read", \
|
||||||
" sleep 5;\"", \
|
"surf-download", useragent, cookiefile, r, u, NULL \
|
||||||
d, useragent, r, cookiefile, NULL \
|
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,11 +105,20 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
|||||||
* The iteration will stop at the first match, beginning at the beginning of
|
* The iteration will stop at the first match, beginning at the beginning of
|
||||||
* the list.
|
* the list.
|
||||||
*/
|
*/
|
||||||
static SiteStyle styles[] = {
|
static SiteSpecific styles[] = {
|
||||||
/* regexp file in $styledir */
|
/* regexp file in $styledir */
|
||||||
{ ".*", "default.css" },
|
{ ".*", "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
|
#define MODKEY GDK_CONTROL_MASK
|
||||||
|
|
||||||
/* hotkeys */
|
/* hotkeys */
|
||||||
@@ -101,28 +128,26 @@ static SiteStyle styles[] = {
|
|||||||
*/
|
*/
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier keyval function arg */
|
/* modifier keyval function arg */
|
||||||
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") },
|
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
|
||||||
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
|
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
|
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
|
|
||||||
{ 0, GDK_KEY_Escape, stop, { 0 } },
|
{ 0, GDK_KEY_Escape, stop, { 0 } },
|
||||||
{ MODKEY, GDK_KEY_c, stop, { 0 } },
|
{ MODKEY, GDK_KEY_c, stop, { 0 } },
|
||||||
|
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .b = 1 } },
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
|
||||||
{ MODKEY, GDK_KEY_r, reload, { .b = 0 } },
|
{ MODKEY, GDK_KEY_r, reload, { .i = 0 } },
|
||||||
|
|
||||||
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
|
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
|
||||||
{ MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
|
{ MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
|
||||||
|
|
||||||
/* Currently we have to use scrolling steps that WebKit2GTK+ gives us
|
/* vertical and horizontal scrolling, in viewport percentage */
|
||||||
* d: step down, u: step up, r: step right, l:step left
|
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
|
||||||
* D: page down, U: page up */
|
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
|
||||||
{ MODKEY, GDK_KEY_j, scroll, { .i = 'd' } },
|
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
|
||||||
{ MODKEY, GDK_KEY_k, scroll, { .i = 'u' } },
|
{ MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
|
||||||
{ MODKEY, GDK_KEY_b, scroll, { .i = 'U' } },
|
{ MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
|
||||||
{ MODKEY, GDK_KEY_space, scroll, { .i = 'D' } },
|
{ MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
|
||||||
{ MODKEY, GDK_KEY_i, scroll, { .i = 'r' } },
|
|
||||||
{ MODKEY, GDK_KEY_u, scroll, { .i = 'l' } },
|
|
||||||
|
|
||||||
|
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
|
||||||
@@ -131,13 +156,14 @@ static Key keys[] = {
|
|||||||
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
|
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
|
||||||
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
|
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
|
||||||
|
|
||||||
{ MODKEY, GDK_KEY_p, clipboard, { .b = 1 } },
|
{ MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
|
||||||
{ MODKEY, GDK_KEY_y, clipboard, { .b = 0 } },
|
{ MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
|
||||||
|
|
||||||
{ MODKEY, GDK_KEY_n, find, { .i = +1 } },
|
{ MODKEY, GDK_KEY_n, find, { .i = +1 } },
|
||||||
{ MODKEY|GDK_SHIFT_MASK, 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_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_t, showcert, { 0 } },
|
||||||
|
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
|
||||||
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
|
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
|
||||||
@@ -148,8 +174,8 @@ static Key keys[] = {
|
|||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } },
|
{ 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_s, toggle, { .i = JavaScript } },
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_v, toggle, { .i = Plugins } },
|
|
||||||
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
|
{ 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_m, toggle, { .i = Style } },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -157,9 +183,9 @@ static Key keys[] = {
|
|||||||
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
|
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
|
||||||
static Button buttons[] = {
|
static Button buttons[] = {
|
||||||
/* target event mask button function argument stop event */
|
/* target event mask button function argument stop event */
|
||||||
{ OnLink, 0, 2, clicknewwindow, { .b = 0 }, 1 },
|
{ OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
|
||||||
{ OnLink, MODKEY, 2, clicknewwindow, { .b = 1 }, 1 },
|
{ OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
|
||||||
{ OnLink, MODKEY, 1, clicknewwindow, { .b = 1 }, 1 },
|
{ OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
|
||||||
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
|
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
|
||||||
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
||||||
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
# surf version
|
# surf version
|
||||||
VERSION = 2.0
|
VERSION = 2.1
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
# paths
|
# paths
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANPREFIX = ${PREFIX}/share/man
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
LIBPREFIX = ${PREFIX}/lib/surf
|
LIBPREFIX = $(PREFIX)/lib
|
||||||
|
LIBDIR = $(LIBPREFIX)/surf
|
||||||
|
|
||||||
X11INC = /usr/X11R6/include
|
X11INC = `pkg-config --cflags x11`
|
||||||
X11LIB = /usr/X11R6/lib
|
X11LIB = `pkg-config --libs x11`
|
||||||
|
|
||||||
GTKINC = `pkg-config --cflags gtk+-3.0 webkit2gtk-4.0`
|
GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
GTKLIB = `pkg-config --libs gtk+-3.0 webkit2gtk-4.0`
|
GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
|
WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
|
||||||
|
WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
|
||||||
|
|
||||||
# includes and libs
|
# includes and libs
|
||||||
INCS = -I. -I/usr/include -I${X11INC} ${GTKINC}
|
INCS = $(X11INC) $(GTKINC)
|
||||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0
|
LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -DWEBEXTDIR=\"${LIBPREFIX}\" -D_DEFAULT_SOURCE
|
CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
|
||||||
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
|
-DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
|
||||||
LDFLAGS = -s ${LIBS}
|
-D_DEFAULT_SOURCE
|
||||||
|
SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS)
|
||||||
|
WEBEXTCFLAGS = -fPIC $(WEBEXTINC)
|
||||||
|
|
||||||
# Solaris
|
# compiler
|
||||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
#CC = c99
|
||||||
#LDFLAGS = ${LIBS}
|
|
||||||
|
|
||||||
# compiler and linker
|
|
||||||
CC = cc
|
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
surf \- simple webkit-based browser
|
surf \- simple webkit-based browser
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B surf
|
.B surf
|
||||||
.RB [-bBdDfFgGiIkKmMnNpPsSvx]
|
.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX]
|
||||||
.RB [-a\ cookiepolicies]
|
.RB [-a\ cookiepolicies]
|
||||||
.RB [-c\ cookiefile]
|
.RB [-c\ cookiefile]
|
||||||
|
.RB [-C\ stylefile]
|
||||||
.RB [-e\ xid]
|
.RB [-e\ xid]
|
||||||
.RB [-r\ scriptfile]
|
.RB [-r\ scriptfile]
|
||||||
.RB [-t\ stylefile]
|
|
||||||
.RB [-u\ useragent]
|
.RB [-u\ useragent]
|
||||||
.RB [-z\ zoomlevel]
|
.RB [-z\ zoomlevel]
|
||||||
.RB "URI"
|
.RB [URI]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
surf is a simple Web browser based on WebKit/GTK+. It is able
|
surf is a simple Web browser based on WebKit/GTK+. It is able
|
||||||
to display websites and follow links. It supports the XEmbed protocol
|
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
|
.TP
|
||||||
.B \-a cookiepolicies
|
.B \-a cookiepolicies
|
||||||
Define the order of
|
Define the order of
|
||||||
.I cookie policies.
|
.I cookie policies\fR.
|
||||||
The default is "Aa@" but could be
|
The default is "@Aa" but could be
|
||||||
redefined in the
|
redefined in the
|
||||||
.I config.h,
|
.IR config.h ,
|
||||||
with "A" meaning to
|
with "A" meaning to
|
||||||
accept all cookies, "a" to deny all cookies and "@", which tells surf to
|
accept all cookies, "a" to deny all cookies and "@", which tells surf to
|
||||||
accept no third party cookies.
|
accept no third party cookies.
|
||||||
.TP
|
.TP
|
||||||
.B \-b
|
.B \-b
|
||||||
Disable Scrollbars
|
Disable Scrollbars.
|
||||||
.TP
|
.TP
|
||||||
.B \-B
|
.B \-B
|
||||||
Enable Scrollbars
|
Enable Scrollbars.
|
||||||
.TP
|
.TP
|
||||||
.B \-c cookiefile
|
.B \-c cookiefile
|
||||||
Specify the
|
Specify the
|
||||||
.I cookiefile
|
.I cookiefile
|
||||||
to use.
|
to use.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-C stylefile
|
||||||
|
Specify the user
|
||||||
|
.IR stylefile .
|
||||||
|
This does disable the site-specific styles.
|
||||||
|
.TP
|
||||||
.B \-d
|
.B \-d
|
||||||
Disable the disk cache.
|
Disable the disk cache.
|
||||||
.TP
|
.TP
|
||||||
@@ -48,7 +53,7 @@ Enable the disk cache.
|
|||||||
.TP
|
.TP
|
||||||
.B \-e xid
|
.B \-e xid
|
||||||
Reparents to window specified by
|
Reparents to window specified by
|
||||||
.I xid.
|
.IR xid .
|
||||||
.TP
|
.TP
|
||||||
.B \-f
|
.B \-f
|
||||||
Start surf in windowed mode (not fullscreen).
|
Start surf in windowed mode (not fullscreen).
|
||||||
@@ -63,16 +68,16 @@ Disable giving the geolocation to websites.
|
|||||||
Enable giving the geolocation to websites.
|
Enable giving the geolocation to websites.
|
||||||
.TP
|
.TP
|
||||||
.B \-i
|
.B \-i
|
||||||
Disable Images
|
Disable Images.
|
||||||
.TP
|
.TP
|
||||||
.B \-I
|
.B \-I
|
||||||
Enable Images
|
Enable Images.
|
||||||
.TP
|
.TP
|
||||||
.B \-k
|
.B \-k
|
||||||
Disable kiosk mode (disable key strokes and right click)
|
Disable kiosk mode (disable key strokes and right click).
|
||||||
.TP
|
.TP
|
||||||
.B \-K
|
.B \-K
|
||||||
Enable kiosk mode (disable key strokes and right click)
|
Enable kiosk mode (disable key strokes and right click).
|
||||||
.TP
|
.TP
|
||||||
.B \-m
|
.B \-m
|
||||||
Disable application of user style sheets.
|
Disable application of user style sheets.
|
||||||
@@ -86,26 +91,21 @@ Disable the Web Inspector (Developer Tools).
|
|||||||
.B \-N
|
.B \-N
|
||||||
Enable the Web Inspector (Developer Tools).
|
Enable the Web Inspector (Developer Tools).
|
||||||
.TP
|
.TP
|
||||||
.B \-p
|
|
||||||
Disable Plugins
|
|
||||||
.TP
|
|
||||||
.B \-P
|
|
||||||
Enable Plugins
|
|
||||||
.TP
|
|
||||||
.B \-r scriptfile
|
.B \-r scriptfile
|
||||||
Specify the user
|
Specify the user
|
||||||
.I scriptfile.
|
.IR scriptfile .
|
||||||
.TP
|
.TP
|
||||||
.B \-s
|
.B \-s
|
||||||
Disable Javascript
|
Disable Javascript.
|
||||||
.TP
|
.TP
|
||||||
.B \-S
|
.B \-S
|
||||||
Enable Javascript
|
Enable Javascript.
|
||||||
.TP
|
.TP
|
||||||
.B \-t stylefile
|
.B \-t
|
||||||
Specify the user
|
Disable strict TLS check.
|
||||||
.I stylefile.
|
.TP
|
||||||
This does disable the site-specific styles.
|
.B \-T
|
||||||
|
Enable strict TLS check.
|
||||||
.TP
|
.TP
|
||||||
.B \-u useragent
|
.B \-u useragent
|
||||||
Specify the
|
Specify the
|
||||||
@@ -115,16 +115,21 @@ which surf should use.
|
|||||||
.B \-v
|
.B \-v
|
||||||
Prints version information to standard output, then exits.
|
Prints version information to standard output, then exits.
|
||||||
.TP
|
.TP
|
||||||
.B \-x
|
.B \-w
|
||||||
Prints xid to standard output. This can be used to script the browser in for
|
Prints xid to standard output. This can be used to script the browser in for
|
||||||
example
|
example
|
||||||
.BR xdotool(1).
|
.BR xdotool(1) .
|
||||||
|
.TP
|
||||||
|
.B -x
|
||||||
|
Disable custom certificates.
|
||||||
|
.TP
|
||||||
|
.B -X
|
||||||
|
Enable custom certificates.
|
||||||
.TP
|
.TP
|
||||||
.B \-z zoomlevel
|
.B \-z zoomlevel
|
||||||
Specify the
|
Specify the
|
||||||
.I zoomlevel
|
.I zoomlevel
|
||||||
which surf should use.
|
which surf should use.
|
||||||
.BR xprop(1).
|
|
||||||
.SH USAGE
|
.SH USAGE
|
||||||
.B Escape
|
.B Escape
|
||||||
Stops loading current page or stops download.
|
Stops loading current page or stops download.
|
||||||
@@ -157,10 +162,10 @@ Scroll horizontally to the left.
|
|||||||
Zooms page in.
|
Zooms page in.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-Shift\-j or Ctrl\--
|
.B Ctrl\-Shift\-j or Ctrl\--
|
||||||
Zooms page out
|
Zooms page out.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-Shift\-q
|
.B Ctrl\-Shift\-q
|
||||||
Resets Zoom
|
Resets Zoom.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-f and Ctrl\-/
|
.B Ctrl\-f and Ctrl\-/
|
||||||
Opens the search-bar.
|
Opens the search-bar.
|
||||||
@@ -189,12 +194,12 @@ Reloads the website without using the cache.
|
|||||||
.B Ctrl\-y
|
.B Ctrl\-y
|
||||||
Copies current URI to primary selection.
|
Copies current URI to primary selection.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-o
|
.B Ctrl\-t
|
||||||
Show the sourcecode of the current page.
|
Display the current TLS certificate in a popup window.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-Shift\-a
|
.B Ctrl\-Shift\-a
|
||||||
Toggle through the the
|
Toggle through the the
|
||||||
.I cookie policies.
|
.I cookie policies\fR.
|
||||||
This will not reload the page.
|
This will not reload the page.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-Shift\-b
|
.B Ctrl\-Shift\-b
|
||||||
@@ -217,9 +222,8 @@ Open the Web Inspector (Developer Tools) window for the current page.
|
|||||||
.B Ctrl\-Shift\-s
|
.B Ctrl\-Shift\-s
|
||||||
Toggle script execution. This will reload the page.
|
Toggle script execution. This will reload the page.
|
||||||
.TP
|
.TP
|
||||||
.B Ctrl\-Shift\-v
|
.B Ctrl\-Shift\-t
|
||||||
Toggle the enabling of plugins on that surf instance. This will reload the
|
Toggle strict TLS check. This will reload the page.
|
||||||
page.
|
|
||||||
.TP
|
.TP
|
||||||
.B F11
|
.B F11
|
||||||
Toggle fullscreen mode.
|
Toggle fullscreen mode.
|
||||||
@@ -251,11 +255,17 @@ images
|
|||||||
.B s S
|
.B s S
|
||||||
scripts
|
scripts
|
||||||
.TP
|
.TP
|
||||||
.B v V
|
|
||||||
plugins
|
|
||||||
.TP
|
|
||||||
.B m M
|
.B m M
|
||||||
styles
|
styles
|
||||||
|
.TP
|
||||||
|
.B f F
|
||||||
|
frame flattening
|
||||||
|
.TP
|
||||||
|
.B x X
|
||||||
|
custom certificates
|
||||||
|
.TP
|
||||||
|
.B t T
|
||||||
|
strict TLS
|
||||||
.SH INDICATORS OF WEB PAGE
|
.SH INDICATORS OF WEB PAGE
|
||||||
The second part of the indicators specifies modes of the web page itself.
|
The second part of the indicators specifies modes of the web page itself.
|
||||||
.SS First character: encryption
|
.SS First character: encryption
|
||||||
@@ -264,7 +274,7 @@ The second part of the indicators specifies modes of the web page itself.
|
|||||||
unencrypted
|
unencrypted
|
||||||
.TP
|
.TP
|
||||||
.B T
|
.B T
|
||||||
encrypted (SSL)
|
encrypted (TLS)
|
||||||
.TP
|
.TP
|
||||||
.B U
|
.B U
|
||||||
attempted encryption but failed
|
attempted encryption but failed
|
||||||
@@ -279,26 +289,17 @@ using proxy
|
|||||||
.B SURF_USERAGENT
|
.B SURF_USERAGENT
|
||||||
If this variable is set upon startup, surf will use it as the
|
If this variable is set upon startup, surf will use it as the
|
||||||
.I useragent
|
.I useragent
|
||||||
string
|
string.
|
||||||
.TP
|
.TP
|
||||||
.B http_proxy
|
.B http_proxy
|
||||||
If this variable is set and not empty upon startup, surf will use it as the http proxy
|
If this variable is set and not empty upon startup, surf will use it as the http proxy.
|
||||||
.SH PLUGINS
|
.SH SIGNALS
|
||||||
For using plugins in surf, first determine your running architecture. Then get
|
Surf will reload the current page on
|
||||||
the appropriate plugin for that architecture and copy it to
|
.BR SIGHUP .
|
||||||
.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
|
.SH SEE ALSO
|
||||||
.BR dmenu(1),
|
.BR dmenu(1),
|
||||||
.BR xprop(1),
|
.BR xprop(1),
|
||||||
.BR tabbed(1),
|
.BR tabbed(1),
|
||||||
.BR nspluginwrapper(1),
|
|
||||||
.BR xdotool(1)
|
.BR xdotool(1)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Please report them!
|
Please report them!
|
||||||
|
|||||||
+106
@@ -0,0 +1,106 @@
|
|||||||
|
#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 <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;
|
||||||
|
|
||||||
|
static void
|
||||||
|
msgsurf(guint64 pageid, const char *s)
|
||||||
|
{
|
||||||
|
static char msg[MSGBUFSZ];
|
||||||
|
size_t sln = strlen(s);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if ((ret = snprintf(msg, sizeof(msg), "%c%s", pageid, s))
|
||||||
|
>= sizeof(msg)) {
|
||||||
|
fprintf(stderr, "webext: msg: message too long: %d\n", ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (send(sock, msg, ret, 0) < 0)
|
||||||
|
fprintf(stderr, "webext: error sending: %s\n", msg+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
readsock(GIOChannel *s, GIOCondition c, gpointer unused)
|
||||||
|
{
|
||||||
|
static char js[48], msg[MSGBUFSZ];
|
||||||
|
WebKitWebPage *page;
|
||||||
|
JSCContext *jsc;
|
||||||
|
GError *gerr = NULL;
|
||||||
|
gsize msgsz;
|
||||||
|
|
||||||
|
if (g_io_channel_read_chars(s, msg, sizeof(msg), &msgsz, &gerr) !=
|
||||||
|
G_IO_STATUS_NORMAL) {
|
||||||
|
if (gerr) {
|
||||||
|
fprintf(stderr, "webext: error reading socket: %s\n",
|
||||||
|
gerr->message);
|
||||||
|
g_error_free(gerr);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgsz < 2) {
|
||||||
|
fprintf(stderr, "webext: readsock: message too short: %d\n",
|
||||||
|
msgsz);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(page = webkit_web_extension_get_page(webext, msg[0])))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
jsc = webkit_frame_get_js_context(webkit_web_page_get_main_frame(page));
|
||||||
|
|
||||||
|
switch (msg[1]) {
|
||||||
|
case 'h':
|
||||||
|
if (msgsz != 3)
|
||||||
|
return TRUE;
|
||||||
|
snprintf(js, sizeof(js),
|
||||||
|
"window.scrollBy(window.innerWidth/100*%d,0);",
|
||||||
|
msg[2]);
|
||||||
|
jsc_context_evaluate(jsc, js, -1);
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
if (msgsz != 3)
|
||||||
|
return TRUE;
|
||||||
|
snprintf(js, sizeof(js),
|
||||||
|
"window.scrollBy(0,window.innerHeight/100*%d);",
|
||||||
|
msg[2]);
|
||||||
|
jsc_context_evaluate(jsc, js, -1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
G_MODULE_EXPORT void
|
||||||
|
webkit_web_extension_initialize_with_user_data(WebKitWebExtension *e,
|
||||||
|
const GVariant *gv)
|
||||||
|
{
|
||||||
|
GIOChannel *gchansock;
|
||||||
|
|
||||||
|
webext = e;
|
||||||
|
|
||||||
|
g_variant_get(gv, "i", &sock);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user