Hacker News new | ask | show | jobs
by georgemcbay 4908 days ago
"Which explains why the Safari user agent string has so much extra information in it, e.g. KHTML, like Gecko — the names of other browser engines."

Wasn't Safari/WebKit largely based on KHTML in the beginning? This doesn't say it wasn't, but seems to imply that there was a separation of the two that was more complete than it really was.

I realize the OP is in a better position than I to know exactly what the reasoning here was, but it seems like reporting yourself as KHTML when you are largely based on the KHTML rendering engine would just be a sensible and practical thing to do outside of all this cloak and dagger stuff.

(Granted, I doubt there were very many websites, if any at all, that gave a rat's ass about special cases for KHTML compatibility).

3 comments

Yes, WebKit was based on KHTML and KJS. Even in the beginning, we made a few fundamental changes. Some of those were folded back in, but eventually those differences grew much, much larger.

There actually were some sites (in Europe, as I recall) that behaved a bit better when "KHTML" was in the user agent string.

I also included it as a nod to the original project. I wanted to show respect for the fine work of Lars Knoll and the other contributors.

That's quite the story, and it's great that you'd keep a reference to a products origins (even if you didn't have to).

On a side note, is it still true that Apple has an entire /8 block of IP addresses? I know that a variety of companies where given them, but I was under the impression that large portions of most had been bought back/given back for use elsewhere?

Apple still has it. You can see the official allocations here: http://www.iana.org/assignments/ipv4-address-space/ipv4-addr...

The only people to return /8's have been Stanford, the DoD, and a few defense contractors (BBN and Boeing).

I don't know whether the Apple IP addresses were reallocated. I do know that Stanford returned most of its Class A allocation.
Apple still owns and uses the entirety of 17.0.0.0/8.
well yeah, because you guys were sending huge blobs of text back instead of proper formatted patches. didn't make you the most welcome forkers out there.
At the time, Microsoft's hegemony over the web browser market was at its peak. Firefox was the only real competitor. If web pages checked the user agent, they probably only accounted for these two browsers. Anything else fell back to legacy behavior, disabling DHTML (later called Web 2.0). This made Gmail suck.

KHTML had almost no market share - it only ran on KDE, and most KDE users used Firefox. Nothing recognized its user agent string, so reporting "KHTML" would have been as ineffectual as reporting "Safari" or "WebKit".

"At the time, Microsoft's hegemony over the web browser market was at its peak. Firefox was the only real competitor."

Actually at the time this is referencing Firefox didn't exist (Gecko did, but Firefox didn't). I'm well aware of the history and why browsers trick out their user agents. If you want to go one level deeper, look no further than the fact that IE still pretends to be Mozilla because of the early days when they were late to the party.

Firefox wasn't a big factor when Safari debuted. And the project was still called "Phoenix" back then. I believe that other Mozilla and Gecko-based browsers were more widely used at that time.
> KHTML had almost no market share - it only ran on KDE, and most KDE users used Firefox.

As mentioned before, Firefox didn't even exist at this point. And KHTML itself actually predates Linux Gecko by a few months as well.

Don Melton forked KHTML/KJS internally in 2001, and announced the work to KDE at the beginning of 2003... GMail wasn't released until 2004!

That is exactly what he is saying. They added KHTML to the user agent string to improve compatibility with servers, since Webkit was essentially KHTML anyway, not to try to hide the actual user agent. Internet Explorer is what they used when hiding the user agent.
If he is trying to say that, then he has my sincere apologies, but it doesn't read like that, at least to me.

eg. he says "the names of other browser engines", not "the name of the browser engine our code was originally based on".

The "like Gecko" part is a bit of a red herring here and mostly irrelevant, as that is simply what KHTML/Konquerer used in its own UA ("KHTML, like Gecko").

The full quote is:

"That allowed me to tweak the string for maximum compatibility with the websites of that time. Which explains why the Safari user agent string has so much extra information in it, e.g. KHTML, like Gecko — the names of other browser engines."

I interpret that as KHTML and Gecko are names of other browser engines that are listed in Safari's user agent string for compatibility purposes.

Fair enough, I'm not trying to suggest this is some grand conspiracy, it just struck me as a funny phrasing given the shared history of the two layout engines.
I'll be clarifying that shared history in a later post. Specifically, what made me select KHTML/KJS over Gecko and other engines.
Will be fascinated to read that. I remember during the keynote when Safari was announced thinking it was bizarre (not to mention risky) that Gecko wasn't used, but, I knew you all must've had your reasons. As a regular user of Safari and/or WebKit on at least five different platforms, I'm rather happy with how it turned out.