2 * Copyright (c) 2011 Conformal Systems LLC <info@conformal.com>
3 * Copyright (c) 2011 Marco Peereboom <marco@peereboom.us>
4 * Copyright (c) 2010, 2011, 2012 Edd Barrett <vext01@gmail.com>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
35 #include <sys/types.h>
36 #if defined(__linux__)
37 #include "linux/util.h"
38 #include "linux/tree.h"
39 #include <bsd/stdlib.h>
42 # if !defined(sane_libbsd_headers)
43 void arc4random_buf(void *, size_t);
44 u_int32_t
arc4random_uniform(u_int32_t
);
46 #elif defined(__FreeBSD__)
48 #include "freebsd/util.h"
52 #elif defined(__OpenBSD__)
59 void arc4random_buf(void *, size_t);
60 uint32_t arc4random_uniform(uint32_t);
63 #include <sys/queue.h>
64 #include <sys/socket.h>
69 #include <gdk/gdkkeysyms.h>
71 #if GTK_CHECK_VERSION(3,0,0)
72 /* we still use GDK_* instead of GDK_KEY_* */
73 #include <gdk/gdkkeysyms-compat.h>
76 #include <webkit/webkit.h>
77 #include <libsoup/soup.h>
78 #include <JavaScriptCore/JavaScript.h>
79 #include <gnutls/gnutls.h>
80 #include <gnutls/x509.h>
82 /* comment if you don't want to use threads */
89 /* #define USE_FLUSH */
91 #define GDK_FLUSH() do { gdk_flush(); } while (0)
94 #endif /* USE_FLUSH */
98 /* set if you don't want to use signals */
99 #ifndef XT_SIGNALS_DISABLE
100 #include <sys/wait.h>
103 /* set if you don't want to use resource limits */
104 #ifndef XT_RESOURCE_LIMITS_DISABLE
105 #include <sys/resource.h>
108 #include "javascript.h"
110 javascript.h borrowed from vimprobable2 under the following license:
112 Copyright (c) 2009 Leon Winter
113 Copyright (c) 2009-2011 Hannes Schueller
114 Copyright (c) 2009-2010 Matto Fransen
115 Copyright (c) 2010-2011 Hans-Peter Deifel
116 Copyright (c) 2010-2011 Thomas Adam
117 Copyright (c) 2011 Albert Kim
118 Copyright (c) 2011 Daniel Carl
120 Permission is hereby granted, free of charge, to any person obtaining a copy
121 of this software and associated documentation files (the "Software"), to deal
122 in the Software without restriction, including without limitation the rights
123 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
124 copies of the Software, and to permit persons to whom the Software is
125 furnished to do so, subject to the following conditions:
127 The above copyright notice and this permission notice shall be included in
128 all copies or substantial portions of the Software.
130 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
131 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
133 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
134 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
135 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
141 #define DPRINTF(x...) do { if (swm_debug) fprintf(stderr, x); } while (0)
142 #define DNPRINTF(n,x...) do { if (swm_debug & n) fprintf(stderr, x); } while (0)
143 #define XT_D_MOVE 0x0001
144 #define XT_D_KEY 0x0002
145 #define XT_D_TAB 0x0004
146 #define XT_D_URL 0x0008
147 #define XT_D_CMD 0x0010
148 #define XT_D_NAV 0x0020
149 #define XT_D_DOWNLOAD 0x0040
150 #define XT_D_CONFIG 0x0080
151 #define XT_D_JS 0x0100
152 #define XT_D_FAVORITE 0x0200
153 #define XT_D_PRINTING 0x0400
154 #define XT_D_COOKIE 0x0800
155 #define XT_D_KEYBINDING 0x1000
156 #define XT_D_CLIP 0x2000
157 #define XT_D_BUFFERCMD 0x4000
158 #define XT_D_INSPECTOR 0x8000
159 #define XT_D_VISITED 0x10000
160 #define XT_D_HISTORY 0x20000
161 #define XT_D_MISC 0x40000
162 extern uint32_t swm_debug
;
164 #define DPRINTF(x...)
165 #define DNPRINTF(n,x...)
168 #define LENGTH(x) (sizeof x / sizeof x[0])
169 #define CLEAN(mask) (mask & ~(GDK_MOD2_MASK) & \
170 ~(GDK_BUTTON1_MASK) & \
171 ~(GDK_BUTTON2_MASK) & \
172 ~(GDK_BUTTON3_MASK) & \
173 ~(GDK_BUTTON4_MASK) & \
176 #define XT_MARKS "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'"
177 #define XT_NOMARKS (sizeof(XT_MARKS) - 1)
178 #define XT_QMARKS "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
179 #define XT_NOQMARKS (sizeof(XT_QMARKS) - 1)
187 TAILQ_ENTRY(tab
) entry
;
189 GtkWidget
*tab_content
;
199 GtkWidget
*uri_entry
;
200 GtkStyle
*default_style
;
201 GtkWidget
*search_entry
;
203 GtkWidget
*browser_win
;
204 GtkWidget
*statusbar_box
;
206 GtkWidget
*statusbar
;
207 GtkWidget
*buffercmd
;
220 GtkWidget
*js_toggle
;
221 GtkEntryCompletion
*completion
;
225 WebKitWebHistoryItem
*item
;
226 WebKitWebBackForwardList
*bfl
;
229 WebKitNetworkRequest
*icon_request
;
230 WebKitDownload
*icon_download
;
231 gchar
*icon_dest_uri
;
233 /* adjustments for browser */
234 GtkAdjustment
*adjust_h
;
235 GtkAdjustment
*adjust_v
;
239 #define XT_MODE_COMMAND (0)
240 #define XT_MODE_INSERT (1)
241 #define XT_MODE_HINT (2)
242 #define XT_MODE_PASSTHROUGH (3)
243 int (*mode_cb
)(struct tab
*, GdkEventKey
*, gpointer
);
244 gpointer mode_cb_data
;
248 int xtp_meaning
; /* identifies dls/favorites */
251 int popup
; /* 1 if cmd_entry has popup visible */
252 int download_requested
;
254 /* https thread stuff */
261 /* custom stylesheet */
271 WebKitWebSettings
*settings
;
275 gboolean load_images
;
278 double mark
[XT_NOMARKS
];
281 WebKitWebInspector
*inspector
;
282 GtkWidget
*inspector_window
;
283 GtkWidget
*inspector_view
;
285 /* focused text entry */
286 WebKitDOMElement
*active
;
288 TAILQ_HEAD(tab_list
, tab
);
298 RB_ENTRY(download
) entry
;
300 WebKitDownload
*download
;
303 RB_HEAD(download_list
, download
);
304 RB_PROTOTYPE(download_list
, download
, entry
, download_rb_cmp
);
307 RB_ENTRY(history
) entry
;
310 time_t time
; /* When the item was added. */
312 RB_HEAD(history_list
, history
);
313 RB_PROTOTYPE(history_list
, history
, entry
, history_rb_cmp
);
315 #define XT_STS_FLAGS_INCLUDE_SUBDOMAINS (1)
316 #define XT_STS_FLAGS_EXPAND (2)
317 #define XT_STS_FILE ("strict-transport")
319 struct strict_transport
{
320 RB_ENTRY(strict_transport
) entry
;
325 RB_HEAD(strict_transport_tree
, strict_transport
);
326 RB_PROTOTYPE(strict_transport_tree
, strict_transport
, entry
, strict_transport_rb_cmp
);
328 struct secviolation
{
329 RB_ENTRY(secviolation
) entry
;
334 RB_HEAD(secviolation_list
, secviolation
);
335 RB_PROTOTYPE(secviolation_list
, secviolation
, entry
, secviolation_rb_cmp
);
338 RB_ENTRY(sv_ignore
) entry
;
341 RB_HEAD(sv_ignore_list
, sv_ignore
);
342 RB_PROTOTYPE(sv_ignore_list
, sv_ignore
, entry
, sv_ignore_rb_cmp
);
345 RB_ENTRY(user_agent
) entry
;
349 RB_HEAD(user_agent_list
, user_agent
);
350 RB_PROTOTYPE(user_agent_list
, user_agent
, entry
, user_agent_rb_cmp
);
353 RB_ENTRY(http_accept
) entry
;
357 RB_HEAD(http_accept_list
, http_accept
);
358 RB_PROTOTYPE(http_accept_list
, http_accept
, entry
, http_accept_rb_cmp
);
361 #define XT_NAME ("xombrero")
362 #define XT_CB_HANDLED (TRUE)
363 #define XT_CB_PASSTHROUGH (FALSE)
364 #define XT_CONF_FILE ("xombrero.conf")
365 #define XT_FAVS_FILE ("favorites")
366 #define XT_SOD_FILE ("startofday")
367 #define XT_RESERVED_CHARS "$&+,/:;=?@ \"<>#%%{}|^~[]`"
369 int run_script(struct tab
*, char *);
370 void xt_icon_from_file(struct tab
*, char *);
371 GtkWidget
*create_window(const gchar
*);
372 void show_oops(struct tab
*, const char *, ...);
373 gchar
*get_html_page(gchar
*, gchar
*, gchar
*, bool);
374 const gchar
*get_uri(struct tab
*);
375 const gchar
*get_title(struct tab
*, bool);
376 void load_uri(struct tab
*t
, gchar
*uri
);
377 gboolean
match_uri(const gchar
*uri
, const gchar
*key
);
378 int valid_url_type(char *);
379 void expand_tilde(char *, size_t, const char *);
380 char *html_escape(const char *val
);
381 void set_status(struct tab
*t
, gchar
*fmt
, ...);
383 void load_webkit_string(struct tab
*, const char *, gchar
*);
384 void button_set_stockid(GtkWidget
*, char *);
387 int remove_cookie(int);
388 int remove_cookie_domain(int);
389 int remove_cookie_all(void);
390 void print_cookie(char *msg
, SoupCookie
*);
391 void setup_cookies(void);
394 int insert_history_item(const gchar
*uri
, const gchar
*title
, time_t time
);
395 int save_global_history_to_disk(struct tab
*t
);
396 int restore_global_history(void);
397 char *color_visited_helper(void);
398 int color_visited(struct tab
*t
, char *visited
);
401 void completion_add(struct tab
*);
402 void completion_add_uri(const gchar
*uri
);
404 /* external editor */
405 #define XT_EE_BUFSZ (64 * 1024)
406 int edit_src(struct tab
*t
, struct karg
*args
);
407 int edit_element(struct tab
*t
, struct karg
*a
);
410 #define XT_PRXY_SHOW (1<<0)
411 #define XT_PRXY_TOGGLE (1<<1)
414 #define XT_INS_SHOW (1<<0)
415 #define XT_INS_HIDE (1<<1)
416 #define XT_INS_CLOSE (1<<2)
418 WebKitWebView
* inspector_inspect_web_view_cb(WebKitWebInspector
*,
419 WebKitWebView
*, struct tab
*);
420 void setup_inspector(struct tab
*);
421 int inspector_cmd(struct tab
*, struct karg
*);
423 /* tld public suffix */
424 void tld_tree_init();
425 char *tld_get_suffix(const char *);
428 #define XT_XTP_STR "xxxt://"
429 #define XT_URI_ABOUT ("about:")
430 #define XT_URI_ABOUT_LEN (strlen(XT_URI_ABOUT))
431 #define XT_URI_ABOUT_ABOUT ("about")
432 #define XT_URI_ABOUT_ALLTHETHINGS ("allthethings")
433 #define XT_URI_ABOUT_BLANK ("blank")
434 #define XT_URI_ABOUT_CERTS ("certs")
435 #define XT_URI_ABOUT_COOKIEWL ("cookiewl")
436 #define XT_URI_ABOUT_COOKIEJAR ("cookiejar")
437 #define XT_URI_ABOUT_DOWNLOADS ("downloads")
438 #define XT_URI_ABOUT_FAVORITES ("favorites")
439 #define XT_URI_ABOUT_HELP ("help")
440 #define XT_URI_ABOUT_HISTORY ("history")
441 #define XT_URI_ABOUT_JSWL ("jswl")
442 #define XT_URI_ABOUT_PLUGINWL ("plwl")
443 #define XT_URI_ABOUT_SET ("set")
444 #define XT_URI_ABOUT_STATS ("stats")
445 #define XT_URI_ABOUT_MARCO ("marco")
446 #define XT_URI_ABOUT_STARTPAGE ("startpage")
447 #define XT_URI_ABOUT_WEBKIT ("webkit")
448 #define XT_URI_ABOUT_SEARCH ("search")
449 #define XT_URI_ABOUT_SECVIOLATION ("secviolation")
453 int (*func
)(struct tab
*, struct karg
*);
458 TAILQ_ENTRY(sp
) entry
;
460 TAILQ_HEAD(sp_list
, sp
);
462 int blank(struct tab
*, struct karg
*);
463 int help(struct tab
*, struct karg
*);
464 int stats(struct tab
*, struct karg
*);
465 void show_certs(struct tab
*, gnutls_x509_crt_t
*,
467 int ca_cmd(struct tab
*, struct karg
*);
468 int cookie_show_wl(struct tab
*, struct karg
*);
469 int xtp_page_ab(struct tab
*, struct karg
*);
470 int xtp_page_cl(struct tab
*, struct karg
*);
471 int xtp_page_dl(struct tab
*, struct karg
*);
472 int xtp_page_fl(struct tab
*, struct karg
*);
473 int xtp_page_hl(struct tab
*, struct karg
*);
474 int xtp_page_sl(struct tab
*, struct karg
*);
475 int xtp_page_sv(struct tab
*, struct karg
*);
476 int parse_xtp_url(struct tab
*, const char *);
477 int add_favorite(struct tab
*, struct karg
*);
478 void update_favorite_tabs(struct tab
*);
479 void update_history_tabs(struct tab
*);
480 void update_download_tabs(struct tab
*);
481 void xtp_generate_keys(void);
482 size_t about_list_size(void);
483 int cookie_cmd(struct tab
*, struct karg
*);
484 int js_cmd(struct tab
*, struct karg
*);
485 int pl_cmd(struct tab
*, struct karg
*);
486 void startpage_add(const char *, ...);
490 * identifies which tabs have xtp pages in (corresponding to about_list indices)
492 #define XT_XTP_TAB_MEANING_NORMAL (-1) /* normal url */
493 #define XT_XTP_TAB_MEANING_BL (1) /* about:blank in this tab */
494 #define XT_XTP_TAB_MEANING_CL (4) /* cookie manager in this tab */
495 #define XT_XTP_TAB_MEANING_DL (5) /* download manager in this tab */
496 #define XT_XTP_TAB_MEANING_FL (6) /* favorite manager in this tab */
497 #define XT_XTP_TAB_MEANING_HL (8) /* history manager in this tab */
498 #define XT_XTP_TAB_MEANING_SL (9) /* search engine chooser */
499 #define XT_XTP_TAB_MEANING_AB (10) /* about:about in this tab */
500 #define XT_XTP_TAB_MEANING_SV (18) /* about:secviolation in tab */
503 #define XT_WL_TOGGLE (1<<0)
504 #define XT_WL_ENABLE (1<<1)
505 #define XT_WL_DISABLE (1<<2)
506 #define XT_WL_FQDN (1<<3) /* default */
507 #define XT_WL_TOPLEVEL (1<<4)
508 #define XT_WL_PERSISTENT (1<<5)
509 #define XT_WL_SESSION (1<<6)
510 #define XT_WL_RELOAD (1<<7)
511 #define XT_SHOW (1<<8)
512 #define XT_DELETE (1<<9)
513 #define XT_SAVE (1<<10)
514 #define XT_OPEN (1<<11)
515 #define XT_CACHE (1<<12)
517 #define XT_WL_INVALID (0)
518 #define XT_WL_JAVASCRIPT (1)
519 #define XT_WL_COOKIE (2)
520 #define XT_WL_PLUGIN (3)
523 RB_ENTRY(domain
) entry
;
525 int handy
; /* app use */
527 RB_HEAD(domain_list
, domain
);
528 RB_PROTOTYPE(domain_list
, domain
, entry
, domain_rb_cmp
);
530 int wl_show(struct tab
*, struct karg
*, char *,
531 struct domain_list
*);
537 TAILQ_ENTRY(alias
) entry
;
539 TAILQ_HEAD(alias_list
, alias
);
547 TAILQ_ENTRY(mime_type
) entry
;
549 TAILQ_HEAD(mime_type_list
, mime_type
);
551 struct domain
* wl_find(const gchar
*, struct domain_list
*);
552 int wl_save(struct tab
*, struct karg
*, int);
553 int toggle_cwl(struct tab
*, struct karg
*);
554 int toggle_js(struct tab
*, struct karg
*);
555 int toggle_pl(struct tab
*, struct karg
*);
557 /* input autofocus */
558 void input_autofocus(struct tab
*);
559 void *input_check_mode(struct tab
*);
560 int command_mode(struct tab
*, struct karg
*);
563 #define XT_BM_NORMAL (0)
564 #define XT_BM_WHITELIST (1)
565 #define XT_BM_KIOSK (2)
567 #define XT_GM_CLASSIC (0)
568 #define XT_GM_MINIMAL (1)
570 #define XT_TABS_NORMAL (0)
571 #define XT_TABS_COMPACT (1)
573 #define XT_STATUSBAR_URL (0)
574 #define XT_STATUSBAR_TITLE (1)
576 #define XT_EM_HYBRID (0)
579 #define XT_DM_START (0)
580 #define XT_DM_ASK (1)
581 #define XT_DM_ADD (2)
583 #define XT_REFERER_ALWAYS (0)
584 #define XT_REFERER_NEVER (1)
585 #define XT_REFERER_SAME_DOMAIN (2)
586 #define XT_REFERER_CUSTOM (3)
587 #define XT_REFERER_SAME_FQDN (4)
589 #define CTRL GDK_CONTROL_MASK
590 #define MOD1 GDK_MOD1_MASK
591 #define SHFT GDK_SHIFT_MASK
593 /* runtime default settings */
594 #define XT_DS_SHOW_TABS (1)
595 #define XT_DS_TAB_STYLE XT_TABS_NORMAL
596 #define XT_DS_STATUSBAR_STYLE XT_STATUSBAR_URL
597 #define XT_DS_SHOW_URL (1)
598 #define XT_DS_SHOW_STATUSBAR (0)
599 #define XT_DS_CTRL_CLICK_FOCUS (0)
600 #define XT_DS_COOKIES_ENABLED (1)
601 #define XT_DS_READ_ONLY_COOKIES (0)
602 #define XT_DS_ENABLE_SCRIPTS (1)
603 #define XT_DS_ENABLE_PLUGINS (1)
604 #define XT_DS_DEFAULT_ZOOM_LEVEL (1.0)
605 #define XT_DS_DEFAULT_SCRIPT ("")
606 #define XT_DS_REFRESH_INTERVAL (10)
607 #define XT_DS_ENABLE_PLUGIN_WHITELIST (0)
608 #define XT_DS_ENABLE_COOKIE_WHITELIST (0)
609 #define XT_DS_ENABLE_JS_WHITELIST (0)
610 #define XT_DS_ENABLE_LOCALSTORAGE (1)
611 #define XT_DS_SESSION_TIMEOUT (3600)
612 #define XT_DS_COOKIE_POLICY SOUP_COOKIE_JAR_ACCEPT_ALWAYS
613 #define XT_DS_SSL_STRICT_CERTS FALSE
614 #define XT_DS_SSL_CA_FILE ("")
615 #define XT_DS_ENABLE_STRICT_TRANSPORT TRUE
616 #define XT_DS_APPEND_NEXT (1)
617 #define XT_DS_HOME ("https://www.cyphertite.com/")
618 #define XT_DS_SEARCH_STRING ("about:search")
619 #define XT_DS_COLOR_VISITED_URIS (1)
620 #define XT_DS_SESSION_AUTOSAVE (0)
621 #define XT_DS_GUESS_SEARCH (0)
622 #define XT_DS_ENABLE_SPELL_CHECKING (0)
623 #define XT_DS_SPELL_CHECK_LANGUAGES ("en_US")
624 #define XT_DS_XTERM_WORKAROUND (0)
625 #define XT_DS_URL_REGEX ("^[[:blank:]]*[^[:blank:]]*([[:alnum:]-]+\\.)+[[:alnum:]-][^[:blank:]]*[[:blank:]]*$")
626 #define XT_DS_ENCODING ("UTF-8")
627 #define XT_DS_AUTOFOCUS_ONLOAD (0)
628 #define XT_DS_ENABLE_JS_AUTORUN (1)
629 #define XT_DS_USERSTYLE_GLOBAL (0)
630 #define XT_DS_AUTO_LOAD_IMAGES (1)
631 #define XT_DS_ENABLE_AUTOSCROLL (0)
632 #define XT_DS_ENABLE_FAVICON_ENTRY (1)
633 #define XT_DS_ENABLE_FAVICON_TABS (0)
634 #define XT_DS_EXTERNAL_EDITOR ("")
635 #define XT_DS_REFERER_MODE XT_REFERER_ALWAYS
636 #define XT_DS_REFERER_CUSTOM ("always")
637 #define XT_DS_DOWNLOAD_NOTIFICATIONS (0)
638 #define XT_DS_CMD_FONT_NAME ("monospace normal 9")
639 #define XT_DS_OOPS_FONT_NAME ("monospace normal 9")
640 #define XT_DS_STATUSBAR_FONT_NAME ("monospace normal 9")
641 #define XT_DS_TABBAR_FONT_NAME ("monospace normal 9")
642 #define XT_DS_ALLOW_INSECURE_CONTENT (TRUE)
643 #define XT_DS_ALLOW_INSECURE_SCRIPTS (TRUE)
647 #define XT_STYLE_CURRENT_TAB (0)
648 #define XT_STYLE_GLOBAL (1)
650 #define XT_TAB_LAST (-4)
651 #define XT_TAB_FIRST (-3)
652 #define XT_TAB_PREV (-2)
653 #define XT_TAB_NEXT (-1)
654 #define XT_TAB_INVALID (0)
655 #define XT_TAB_NEW (1)
656 #define XT_TAB_DELETE (2)
657 #define XT_TAB_DELQUIT (3)
658 #define XT_TAB_OPEN (4)
659 #define XT_TAB_UNDO_CLOSE (5)
660 #define XT_TAB_SHOW (6)
661 #define XT_TAB_HIDE (7)
662 #define XT_TAB_NEXTSTYLE (8)
663 #define XT_TAB_LOAD_IMAGES (9)
664 #define XT_TAB_ONLY (10)
666 #define XT_URL_SHOW (1)
667 #define XT_URL_HIDE (2)
674 TAILQ_ENTRY(key_binding
) entry
; /* in bss so no need to init */
676 TAILQ_HEAD(keybinding_list
, key_binding
);
681 TAILQ_ENTRY(custom_uri
) entry
;
683 TAILQ_HEAD(custom_uri_list
, custom_uri
);
688 TAILQ_ENTRY(cmd_alias
) entry
;
690 TAILQ_HEAD(cmd_alias_list
, cmd_alias
);
695 #define XT_S_INVALID (0)
698 #define XT_S_FLOAT (3)
700 #define XT_SF_RESTART (1<<0)
701 #define XT_SF_RUNTIME (1<<1)
706 int (*activate
)(char *);
709 int set(struct tab
*, struct karg
*);
710 size_t get_settings_size(void);
711 int settings_add(char *, char *);
712 void setup_proxy(char *);
713 int set_browser_mode(struct settings
*, char *);
714 int set_encoding(struct tab
*, struct karg
*);
715 int set_gui_mode(struct settings
*, char *);
716 int set_cookie_policy(struct settings
*, char *);
717 int set_search_string(char *);
718 int set_ssl_ca_file(struct settings
*, char *);
719 char *get_browser_mode(struct settings
*);
720 char *get_gui_mode(struct settings
*);
721 char *get_cookie_policy(struct settings
*);
722 void init_keybindings(void);
723 void config_parse(char *, int);
724 char *get_setting_name(int);
725 void statusbar_set_visibility(void);
726 int tabaction(struct tab
*, struct karg
*);
727 int urlaction(struct tab
*, struct karg
*);
728 int userstyle_cmd(struct tab
*, struct karg
*);
729 struct tab
*get_current_tab(void);
730 int resizetab(struct tab
*, struct karg
*);
731 int cert_cmd(struct tab
*, struct karg
*);
732 void focus_webview(struct tab
*);
733 int is_g_object_setting(GObject
*, char *);
735 #define XT_DL_START (0)
736 #define XT_DL_RESTART (1)
737 int download_start(struct tab
*, struct download
*, int flag
);
740 extern int enable_socket
;
741 extern int single_instance
;
742 extern int fancy_bar
;
743 extern int browser_mode
;
744 extern int enable_localstorage
;
745 extern char *statusbar_elems
;
746 extern SoupURI
*proxy_uri
;
748 extern int show_tabs
;
749 extern int tab_style
;
750 extern int statusbar_style
;
752 extern int show_statusbar
;
753 extern int ctrl_click_focus
;
754 extern int cookies_enabled
;
755 extern int read_only_cookies
;
756 extern int enable_scripts
;
757 extern int enable_plugins
;
758 extern gfloat default_zoom_level
;
759 extern char default_script
[PATH_MAX
];
760 extern int window_height
;
761 extern int window_width
;
762 extern int window_maximize
;
763 extern int icon_size
;
764 extern int refresh_interval
;
765 extern int enable_plugin_whitelist
;
766 extern int enable_cookie_whitelist
;
767 extern int enable_js_whitelist
;
768 extern int session_timeout
;
769 extern int cookie_policy
;
770 extern char ssl_ca_file
[PATH_MAX
];
771 extern char *resource_dir
;
772 extern gboolean ssl_strict_certs
;
773 extern gboolean enable_strict_transport
;
774 extern int append_next
;
776 extern char *search_string
;
777 extern char *http_proxy
;
778 extern int http_proxy_starts_enabled
;
779 extern char *external_editor
;
780 extern char download_dir
[PATH_MAX
];
781 extern int download_mode
;
782 extern char runtime_settings
[PATH_MAX
];
783 extern int allow_volatile_cookies
;
784 extern int color_visited_uris
;
785 extern int save_global_history
;
786 extern struct user_agent
*user_agent
;
787 extern struct http_accept
*http_accept
;
788 extern int save_rejected_cookies
;
789 extern int session_autosave
;
790 extern int guess_search
;
791 extern gint max_connections
;
792 extern gint max_host_connections
;
793 extern gint enable_spell_checking
;
794 extern char *spell_check_languages
;
795 extern int xterm_workaround
;
796 extern char *url_regex
;
797 extern int history_autosave
;
798 extern char search_file
[PATH_MAX
];
799 extern char command_file
[PATH_MAX
];
800 extern char *encoding
;
801 extern int autofocus_onload
;
802 extern int enable_js_autorun
;
803 extern char *cmd_font_name
;
804 extern char *oops_font_name
;
805 extern char *statusbar_font_name
;
806 extern char *tabbar_font_name
;
807 extern int edit_mode
;
808 extern char *userstyle
;
809 extern char *stylesheet
;
810 extern int userstyle_global
;
811 extern int auto_load_images
;
812 extern int enable_autoscroll
;
813 extern int enable_favicon_entry
;
814 extern int enable_favicon_tabs
;
815 extern int referer_mode
;
816 extern char *referer_custom
;
817 extern int download_notifications
;
818 extern int warn_cert_changes
;
819 extern regex_t url_re
;
820 extern int allow_insecure_content
;
821 extern int allow_insecure_scripts
;
824 extern void (*os_init
)(void);
825 extern char *version
;
826 extern char *icons
[];
827 extern char rc_fname
[PATH_MAX
];
828 extern char work_dir
[PATH_MAX
];
829 extern char temp_dir
[PATH_MAX
];
830 extern struct passwd
*pwd
;
831 extern SoupCookieJar
*s_cookiejar
;
832 extern SoupCookieJar
*p_cookiejar
;
833 extern SoupSession
*session
;
834 extern GtkNotebook
*notebook
;
835 extern GtkListStore
*completion_model
;
836 extern uint64_t blocked_cookies
;
838 extern void (*_soup_cookie_jar_add_cookie
)(SoupCookieJar
*, SoupCookie
*);
840 extern struct history_list hl
;
841 extern int hl_purge_count
;
842 extern struct download_list downloads
;
843 extern struct tab_list tabs
;
844 extern struct about_type about_list
[];
845 extern struct domain_list c_wl
;
846 extern struct domain_list js_wl
;
847 extern struct domain_list pl_wl
;
848 extern struct strict_transport_tree st_tree
;
849 extern struct alias_list aliases
;
850 extern struct mime_type_list mtl
;
851 extern struct keybinding_list kbl
;
852 extern struct sp_list spl
;
853 extern struct user_agent_list ua_list
;
854 extern struct http_accept_list ha_list
;
855 extern struct cmd_alias_list cal
;
856 extern struct custom_uri_list cul
;
857 extern struct secviolation_list svl
;
858 extern struct sv_ignore_list svil
;
860 extern PangoFontDescription
*cmd_font
;
861 extern PangoFontDescription
*oops_font
;
862 extern PangoFontDescription
*statusbar_font
;
863 extern PangoFontDescription
*tabbar_font
;