title: Setting the Default Search Provider on Chrome via a script
body: <p>I am attempting to set various Google Chrome preferences via a script (on both OS X and Windows). I can successfully set a number of preferences, and add bookmarks, by editing the Preferences and Bookmarks json files in the user's Application Data folder. However, when i attempt to set a new default search provider, the browser automatically reverts to Google search.</p>
  
  <p>The default search provider node in the Preferences file looks like this:</p>
  
  <pre><code>"default_search_provider": {
      "enabled": true,
      "encodings": "UTF-8",
      "icon_url": "http://www.google.com/favicon.ico",
      "id": "2",
      "instant_url": "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&amp;ie={inputEncoding}&amp;ion=1{searchTerms}&amp;nord=1",
      "keyword": "google.com",
      "name": "Google",
      "prepopulate_id": "1",
      "search_url": "{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&amp;ie={inputEncoding}&amp;q={searchTerms}",
      "suggest_url": "{google:baseSuggestURL}search?client=chrome&amp;hl={language}&amp;q={searchTerms}"
  }
  </code></pre>
  
  <p>In order to add my desired search provider, I've simply added it manually (via the wrench menu), viewed the effect of this action on the json file, and then written a script to mimic these changes. However, when I change it via a script, the default search provider is used for the first search, but then resets the next time chrome is started. What am i missing here?</p>