Google Chrome disables initial search engine selection in Russia

Google Chrome search engine selection dialog

That’s how Google Chrome welcomes you when you first start it. Good move in the “don’t be evil” style, isn’t it?

But there’s one country where this message doesn’t show up – Russia. Why?

The answer is the commit recently discovered in Chromium (which is upstream to Google Chrome):

$ svn diff -r84234:84235 http://src.chromium.org/svn/trunk/src
...
Index: chrome/browser/first_run/first_run.cc
===================================================================
--- chrome/browser/first_run/first_run.cc   (revision 84234)
+++ chrome/browser/first_run/first_run.cc   (revision 84235)
@@ -396,6 +396,14 @@
 }

 // static
+bool FirstRun::SearchEngineSelectorDisallowed() {
+  // For now, the only case in which the search engine dialog should never be
+  // shown is if the locale is Russia.
+  std::string locale = g_browser_process->GetApplicationLocale();
+  return (locale == "ru");
+}
+
+// static
 bool FirstRun::SetOEMFirstRunBubblePref() {
   PrefService* local_state = g_browser_process->local_state();
   if (!local_state)
Index: chrome/browser/first_run/first_run.h
===================================================================
--- chrome/browser/first_run/first_run.h    (revision 84234)
+++ chrome/browser/first_run/first_run.h    (revision 84235)
@@ -141,6 +141,10 @@
   // Returns false if the pref could not be set.
   static bool SetPersonalDataManagerFirstRunPref();

+  // True if special circumstances should prevent the search engine ballot from
+  // being shown.
+  static bool SearchEngineSelectorDisallowed();
+
  private:
   friend class FirstRunTest;
   FRIEND_TEST_ALL_PREFIXES(Toolbar5ImporterTest, BookmarkParse);

This code was added in May 2011, linking to bug 81578. Note the comment about the “special circumstances [that] should prevent the search engine ballot from being shown”. What are these circumstances?

Russia is one a few countries where Google is not the leading search engine, losing to Yandex.

In addition to Russia, Google isn’t leading in South Korea, Czech Republic, China. Only in Russia Google decided to go against “Don’t be evil”.

Should we expect more countries to join the exception list?

Simple bookmarklet that adds markdown tags in Gmail

About a month ago Posterous announced Markdown support. I started using for all my posts. But it soon became tiresome to always type "<markdown> </markdown>" spell.

Here's a solution - a bookmarklet that adds <markdown> tags in Gmail Compose Mail view. Create a new bookmark and paste the following as its URL:

javascript:(function(){document.getElementById('canvas_frame').contentDocument.getElementsByName('body')[0].value+='<markdown>\n</markdown>'})()

Then go to Gmail Compose view and click this bookmark. That's all!

(tested in Google Chrome)

Posterous silently changes all external links on users' posts

Some time ago I noticed that Posterous breaks middle click for links in my posts. Middle click behaves as if you've pressed left click (at least in Google Chrome). Strangely, Ctrl+left click works as intended. At that time I didn't pay much attention to it.
 
But yesterday I tried to copy a link from some Posterous blog. The link was mangled! Try it youself - copy this Google link. Instead of
http://www.google.com
you'll get
http://api.viglink.com/api/click?key=8eb8c964d427e97a1567cec6532655f0&v=1&libId=1272660521808&loc=http%3A%2F%2Fshamrin.posterous.com%2Fposterous-silently-changes-all-external-links&out=http%3A%2F%2Fwww.google.com%2F&txt=http%3A%2F%2Fwww.google.com&title=%0A%09%09Posterous%20silently%20changes%20all%20external%20links%20on%20users'%20posts%20-%20Alexey%20Shamrin%0A%09&format=go
(JavaScript must be enabled. I've tested it on Google Chrome and Internet Explorer, all on Windows 7. It's important to wait for the page to finish loading.)
 
Aha! Posterous is using third-party service here - VigLink. I haven't heard of it before (even Hacker News is was silent about it).
 
From TechCrunch coverage on VigLink:
 
To start using VigLink, publishers simply drop a snippet of JavaScript into their pages. Then, whenever the publisher links to a valid product (say, some shoes on Amazon), VigLink will automatically convert that standard link into an affiliate link. The publisher still determines which stores and products they’re linking to — VigLink simply modifies that link to include the proper affiliate program URL.

I am torn on this issue. On one hand, it's perfectly understandable that Posterous tries to monetize on its users. On the other hand, I want my links on my blog to stay intact! Or at least I want to be informed about this mangling. And I want a way to turn this "feature" off. (Tried to edit my Posterous theme, but VigLink magic doesn't show up there.)

Update: see Hacker News thread for great discussion

Update 2: "copy link" trick doesn't seem to work for everybody (e.g. Safari). The best way to test it is to use some tool to monitor HTTP requests.

Update 3: After several hours after posting this I couldn't repeat "copy link" trick. Neither in Chrome, nor in Internet Explorer. And middle click now works as intended in Chrome. It seems Posterous and/or VigLink changed some of their algorithms. They didn't get rid of affiliate magic (VigLink javascript is still there). But thanks for fixing bugs - the most annoying for me was non-working middle-click in Chrome.