From 9735f4d4368eaacd95fc0fd2af07d8f218450fbd Mon Sep 17 00:00:00 2001 From: John Foerch Date: Tue, 6 Apr 2010 19:42:37 -0400 Subject: [PATCH] add program name and version to user-agent string --- modules/conkeror.js | 1 + modules/user-agent.js | 15 +++++++++++++++ modules/utils.js | 7 ------- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 modules/user-agent.js diff --git a/modules/conkeror.js b/modules/conkeror.js index 7af01b0..8a65112 100644 --- a/modules/conkeror.js +++ b/modules/conkeror.js @@ -29,6 +29,7 @@ require("extension.js", null); require("array.js", null); require("builtin-commands.js", null); +require("user-agent.js", null); require("utils.js", null); require("interactive.js", null); require("minibuffer.js", null); diff --git a/modules/user-agent.js b/modules/user-agent.js new file mode 100644 index 0000000..f9b456c --- /dev/null +++ b/modules/user-agent.js @@ -0,0 +1,15 @@ +/** + * (C) Copyright 2007-2010 John J. Foerch + * (C) Copyright 2007-2008 Jeremy Maitin-Shepard + * + * Use, modification, and distribution are subject to the terms specified in the + * COPYING file. +**/ + +default_pref("general.useragent.extra.conkeror", "Conkeror/"+version); + +function set_user_agent (str) { + session_pref("general.useragent.override", str); +} + + diff --git a/modules/utils.js b/modules/utils.js index 6225c91..b84c732 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -320,13 +320,6 @@ function generate_QI () { } -const USER_AGENT_OVERRIDE_PREF = "general.useragent.override"; - -function set_user_agent (str) { - session_pref(USER_AGENT_OVERRIDE_PREF, str); -} - - function abort (str) { var e = new Error(str); e.__proto__ = abort.prototype; -- 2.11.4.GIT