Thanks to Christian Hesse <mail@eworm.de>!
static time_t sessiontime = 3600;
static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
static time_t sessiontime = 3600;
static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
+static Bool kioskmode = FALSE; /* Ignore shortcuts */
/* Webkit default features */
static Bool enablescrollbars = TRUE;
/* Webkit default features */
static Bool enablescrollbars = TRUE;
surf \- simple webkit-based browser
.SH SYNOPSIS
.B surf
surf \- simple webkit-based browser
.SH SYNOPSIS
.B surf
.RB [-c\ cookiefile]
.RB [-e\ xid]
.RB [-r\ scriptfile]
.RB [-c\ cookiefile]
.RB [-e\ xid]
.RB [-r\ scriptfile]
.B \-i
Disable Images
.TP
.B \-i
Disable Images
.TP
+.B \-k
+Enable kiosk mode (disable key strokes and right click)
+.TP
.B \-n
Disable the Web Inspector (Developer Tools).
.TP
.B \-n
Disable the Web Inspector (Developer Tools).
.TP
g_signal_connect(G_OBJECT(c->win),
"destroy",
G_CALLBACK(destroywin), c);
g_signal_connect(G_OBJECT(c->win),
"destroy",
G_CALLBACK(destroywin), c);
- g_signal_connect(G_OBJECT(c->win),
- "key-press-event",
- G_CALLBACK(keypress), c);
+ if(!kioskmode) {
+ g_signal_connect(G_OBJECT(c->win),
+ "key-press-event",
+ G_CALLBACK(keypress), c);
+ }
/* Pane */
c->pane = gtk_vpaned_new();
/* Pane */
c->pane = gtk_vpaned_new();
enablespatialbrowsing, NULL);
g_object_set(G_OBJECT(settings), "enable-developer-extras",
enableinspector, NULL);
enablespatialbrowsing, NULL);
g_object_set(G_OBJECT(settings), "enable-developer-extras",
enableinspector, NULL);
+ g_object_set(G_OBJECT(settings), "enable-default-context-menu",
+ kioskmode ^ 1, NULL);
if(enableinspector) {
c->inspector = WEBKIT_WEB_INSPECTOR(
if(enableinspector) {
c->inspector = WEBKIT_WEB_INSPECTOR(
static void
newwindow(Client *c, const Arg *arg, gboolean noembed) {
guint i = 0;
static void
newwindow(Client *c, const Arg *arg, gboolean noembed) {
guint i = 0;
- const char *cmd[11], *uri;
+ const char *cmd[12], *uri;
const Arg a = { .v = (void *)cmd };
char tmp[64];
const Arg a = { .v = (void *)cmd };
char tmp[64];
}
if(!loadimages)
cmd[i++] = "-i";
}
if(!loadimages)
cmd[i++] = "-i";
+ if(!kioskmode)
+ cmd[i++] = "-k";
if(!enableplugins)
cmd[i++] = "-p";
if(!enablescripts)
if(!enableplugins)
cmd[i++] = "-p";
if(!enablescripts)
static void
usage(void) {
static void
usage(void) {
- die("usage: %s [-binpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
+ die("usage: %s [-biknpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
" [-t stylefile] [-u useragent] [uri]\n", basename(argv0));
}
" [-t stylefile] [-u useragent] [uri]\n", basename(argv0));
}
case 'i':
loadimages = 0;
break;
case 'i':
loadimages = 0;
break;
+ case 'k':
+ kioskmode = 1;
+ break;
case 'n':
enableinspector = 0;
break;
case 'n':
enableinspector = 0;
break;