new-tabs: fix bug in tab_bar_kill_buffer
[conkeror.git] / modules / user-agent.js
blob7611ca755834465535d9f184217bb233dfae81d8
1 /**
2  * (C) Copyright 2007-2011 John J. Foerch
3  * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
4  *
5  * Use, modification, and distribution are subject to the terms specified in the
6  * COPYING file.
7 **/
9 default_pref("general.useragent.extra.conkeror", "Conkeror/"+version);
11 /**
12  * set_user_agent overrides the user agent string globally with whatever
13  * string is passed to it.  If called with null or no argument, any
14  * current override is undone, reverting to Conkeror's default user agent
15  * string.  The override is performed (rather non-conventionally) with a
16  * default pref instead of a user pref, which allows the override to be
17  * done cleanly from the rc, without interference by persisting prefs in
18  * the profile.
19  */
20 function set_user_agent (str) {
21     const p = "general.useragent.override";
22     if (str == null) {
23         clear_default_pref(p);
24         try {
25             clear_pref(p);
26         } catch (e) {}
27     } else
28         session_pref(p, str);