From 0caa05e44f831f671665a75b41e35ca9b4d80f61 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Wed, 16 Dec 2009 16:56:45 +0000 Subject: [PATCH] Tweak to improve readability and reduce dcalls to write method svn: r13825 --- src/plugins/view/htmlrenderer.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/view/htmlrenderer.py b/src/plugins/view/htmlrenderer.py index 55c9a4dea..eabdd1734 100644 --- a/src/plugins/view/htmlrenderer.py +++ b/src/plugins/view/htmlrenderer.py @@ -89,7 +89,21 @@ WEBKIT = 1 MOZILLA = 2 KITNAME = [ "None", "WebKit", "Mozilla" ] URL_SEP = '/' - +MOZJS = ''' +user_pref("network.proxy.type", 1); +user_pref("network.proxy.http", %(host)s); +user_pref("network.proxy.http_port", %(port)s); +user_pref("network.proxy.no_proxies_on", + "127.0.0.1,localhost,localhost + .localdomain") +user_pref("network.proxy.share_proxy_settings", true); +user_pref("network.http.proxy.pipelining", true); +user_pref("network.http.proxy.keep-alive", true); +user_pref("network.http.proxy.version", 1.1); +user_pref("network.http.sendRefererHeader, 0); +user_pref("general.useragent.extra.firefox, "Mozilla/5.0"); +user_pref("general.useragent.locale, "fr"); +''' #------------------------------------------------------------------------- # # What Web interfaces ? @@ -381,6 +395,8 @@ class RendererMozilla(Renderer): port = int(hport[2]) if port and host: port = str(port) + prefs.write(MOZJS % vars()) + ''' prefs.write('user_pref("network.proxy') prefs.write('.type", 1);\r\n') prefs.write('user_pref("network.proxy') @@ -405,6 +421,7 @@ class RendererMozilla(Renderer): prefs.write('.extra.firefox, "Mozilla/5.0");\r\n') prefs.write('user_pref("general.useragent') prefs.write('.locale, "fr");\r\n') + ''' prefs.close() except: try: # trying to remove pref.js in case of proxy change.