On Tue, Sep 14, 2010 at 08:27:15AM -0500, Kumar Appaiah wrote:
> tags 596653 + upstream
> thanks
> 
> On Sun, Sep 12, 2010 at 10:17:29PM -0500, Kumar Appaiah wrote:
> > Since the Luakit user-agent string does not contain any reference to
> > Gecko (and maybe KHTML), the new Flickr website is not at all
> > functional. Clicking on any of the buttons such as "Actions" or "Share
> > This" just displays some moving Flickr logo balls, but doesn't do go
> > anywhere. Similarly, the map on the geotagged photos doesn't "react"
> > by autozooming when the mouse goes over. This is since their
> > Javascript seems sensitive to the user-agent string.
> > 
> > By adding a "KHTML (like Gecko)" reference, which shouldn't be too
> > deprecating to Luakit, in my opinion, the problem goes away. A simple
> > patch is attached. As always, feel free to overrule. ;-)
> 
> After a chat with upstream, it was decided that using "AppleWebKit"
> and the Webkit build identifier seems a better alternative. New patch
> attached.

Now really attached.

Kumar
-- 
Now, it we had this sort of thing:
  yield -a     for yield to all traffic
  yield -t     for yield to trucks
  yield -f     for yield to people walking (yield foot)
  yield -d t*  for yield on days starting with t

...you'd have a lot of dead people at intersections, and traffic jams you
wouldn't believe...
                -- Discussion on the intuitiveness of commands
>From 7772ce0b6ee00255c1be74e72682a2c944cdcedd Mon Sep 17 00:00:00 2001
From: Kumar Appaiah <[email protected]>
Date: Tue, 14 Sep 2010 08:22:40 -0500
Subject: [PATCH] Add AppleWebKit and Webkit-build specific version to user agent string

Since the Luakit user-agent string does not contain any reference to
Gecko (and maybe KHTML), some websites, such as the new Flickr
website, are not fully functional. This patch extracts the build
version provided by the WEBKIT_USER_AGENT macros to solve this problem.
---
 common/tokenize.gperf |    2 ++
 config/globals.lua    |    4 +++-
 luah.c                |    2 ++
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/common/tokenize.gperf b/common/tokenize.gperf
index 4d88c11..d63dd5a 100644
--- a/common/tokenize.gperf
+++ b/common/tokenize.gperf
@@ -91,6 +91,8 @@ version
 webkit_major_version
 webkit_micro_version
 webkit_minor_version
+webkit_user_agent_major_version
+webkit_user_agent_minor_version
 webview
 window
 windows
diff --git a/config/globals.lua b/config/globals.lua
index 3361ff7..f587b28 100644
--- a/config/globals.lua
+++ b/config/globals.lua
@@ -15,7 +15,9 @@ local rv, out, err = luakit.spawn_sync("uname -sm")
 local webkit_version = string.format("WebKitGTK+/%d.%d.%d", luakit.webkit_major_version,
     luakit.webkit_minor_version, luakit.webkit_micro_version)
 local luakit_version = string.format("luakit/%s", luakit.version)
-globals.useragent = string.format("Mozilla/5.0 (%s) %s %s", string.match(out, "([^\n]*)"), webkit_version, luakit_version)
+local webkit_ua_major_version = luakit.webkit_user_agent_major_version
+local webkit_ua_minor_version = luakit.webkit_user_agent_minor_version
+globals.useragent = string.format("Mozilla/5.0 (%s) AppleWebKit/%s.%s+ %s %s", string.match(out, "([^\n]*)"), webkit_ua_major_version, webkit_ua_minor_version, webkit_version, luakit_version)
 
 -- Search common locations for a ca file which is used for ssl connection validation.
 local ca_files = {luakit.data_dir .. "/ca-certificates.crt",
diff --git a/luah.c b/luah.c
index 554391a..852738a 100644
--- a/luah.c
+++ b/luah.c
@@ -516,6 +516,8 @@ luaH_luakit_index(lua_State *L)
       PI_CASE(WEBKIT_MAJOR_VERSION, webkit_major_version())
       PI_CASE(WEBKIT_MINOR_VERSION, webkit_minor_version())
       PI_CASE(WEBKIT_MICRO_VERSION, webkit_micro_version())
+      PI_CASE(WEBKIT_USER_AGENT_MAJOR_VERSION, WEBKIT_USER_AGENT_MAJOR_VERSION)
+      PI_CASE(WEBKIT_USER_AGENT_MINOR_VERSION, WEBKIT_USER_AGENT_MINOR_VERSION)
 
       case L_TK_WINDOWS:
         lua_newtable(L);
-- 
1.7.1

Reply via email to