Curious what happens when Safari launches with a new profile? Me too, so I fired up a proxy, and watched.
Here is what I found…
To kick this thread off, lets take a close look at that initial loading screen. For setup, I temporarily set aside the Library/Safari folder, thus giving myself a fresh profile on the subsequent launch. Check out those icons. Where do you think they're hosted/stored?
Safari launches with default 'favorites', each represented by a favicon. I assumed these would be local resources—I was wrong. Here's a look at the structure of requests produced by the proxy application. You'll notice overlaps between hosts and earlier favicons.
Safari issues numerous requests for just about each icon. The first is to apple.com, the page itself. I assume this then crawls the markup for meta tags containing links to Apple-ready icons. Oddly enough, this page does not have any relevant meta tags.
What you would expect to find is a link tag like <link rel="apple-touch-icon" href="icon.png">. iOS used to add effects to icons, but you could avoid that with a 'precomposed' image. Since iOS 7.0, effects are no longer added, so precomposed icons are less common.
All that said, Safari still looks for the precomposed icon and the default when a tag for neither is found. This bring us to our next request, for the 404'd precomposed image. Lastly, it issues a request for apple-touch-icon, which succeeds in loading the image. A cookie is set.
So for the first image, we issued 3 requests. Further, we acquired our first cookies before even using the browser. Next up, we'll need that Bing icon. Bing also lacks the meta tags, but has a precomposed image. Bing too will set several cookies.
This process repeats for the rest of these icons. For each, the domain is pinged. The markup (I assume) is crawled. If/when no relevant meta tags are found, Safari begins to look for known files. I suspect looking for known filenames first would save more data.
Our trip to gather up the Yahoo icon results in some failed DNS-prefetch and preconnect calls. These will be found in the <head> of the Yahoo site.
The next request is for google.com. Safari wasn't able to find either icon by its filename, but did see a meta tag in Google's source. Note, it requested the Google page twice; once with one ua-string, and again with the standard Safari ua-string. Also, more cookies!
I'm going to skip a bit here as this becomes redundant. Safari makes many other requests for icons on the first-run page. It is safe to assume each of these hosts sets one or more cookies, with few exceptions.
I'll end this thread with the following image, which shows hosts that were contacted during the first run of Safari on a fresh profile: Apple, Bing, Yahoo, Google, Wikipedia, Facebook, Twitter, LinkedIn, Weather, Yelp, Trip Advisor, and subsidiary host like abs.twimg, etc.
If you enjoyed this thread, be sure to check out previous first-run threads:
WordPress, for all the good it has done, simply cannot help but to screw up the simplest things.
<pre>\\.well-known</pre>
In walks WordPress, "Oh, let me quadruple those backslashes for you."
So I try \, which WordPress then converts into &#92;!
I just can't win here.
Yes, I know to make changes in the TEXT view, and not the Visual view. Tragically, that will give you all sorts of [other] problems, like randomly eating carriage-returns, or inserting a <br> here and there. This utility simply isn't cut-out for sharing code(-like) content.
Wait, wait—I got the formatting to stick, and the content to look the way I wanted.
Windows uses values 0D 0A to signify a line-break. Mac uses 0A.
TIL—Windows XP had a bug causing Notepad to insert 0D 0D 0A. It wouldn't save like that, but if you copied and pasted the contents elsewhere the bytes could be preserved to this day.
Reminded me how cool the comma operator is in JavaScript:
return Expr, …, Expr
Evaluates each expression, but returns result of last.
Ti be more clear, the return statement returns the result of the Expression (if any) to its right. Expressions can contain Expressions. So each of the expressions in a list are evaluated, but only the result of the final is returned.
I think I first read about this little detail in one of @rauschma's fantastic deep-dive posts, but I'm not sure which one.
In 1992 Phillip Hallam-Baker and Tim Berners-Lee were developing HTTP. Phillip suggested a request header to record the URI of the linking-document, and "referer" (a spellcheck failure) was born. Servers now knew what site sent you their way.
In 1993 a young developer working on the Mosaic browser added support for inline images. Before this, images could only be linked from a page and viewed separately. Images from remote servers were supported as well, and requests for them would eventually include a referer header.
In 1994 Lou "solved" statelessness on the Web. Cookies could be set by a server, and would be returned to that server with future requests. Session IDs could move out of the URL path, and into a more convenient home. Like images and referer, cookies worked with third parties too.
Over the years there have been various ways to sniff the user's web history with CSS and JavaScript. For example, generating 10,000 links & checking their color (visited differs by default). These are now blocked, but I wonder how often advertisers and exchanges engaged in this.
Clever developers would adapt to these changes, turning their focus from the links to the style of adjacent elements with :visited + span, and then reading span's computedStyle to see how it looks. Background images could be used in a similar manner; listen for what loads.
Even when you lock-down CSS, developers would sniff your cache by using sensitive clocks in JS and seeing how quickly resources loads. If 2 similar resources load at very different rates, one could be inferred to have been loaded from cache (indicating user visited a given site).