title: Passing string/JSON from C# to JS using CefSharp
body: <p>I have an html page, which I want to host in my C# application (WPF).
  since I need the browser to be Chromium based I'm using cefSharp.</p>
  
  <p>I want to pass string data from C# to the JS for the page's initialization.</p>
  
  <p>I found <code>RegisterJsObject</code> which lets me access a C# object from JS,  but I can't seem to pass any string information from it.</p>
  
  <p>My code currently looks something like this:</p>
  
  <p>C#:</p>
  
  <pre><code>mainWindow.browser.RegisterJsObject("csobj", "a string");
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>...
  console.log(JSON.stringify(window.csobj)); //I get an empty obj {}
  </code></pre>
  
  <p>I've also tried to define my own object with a <code>public string GetJson()</code> method,  but then JS doesn't recognize it as a function, I assume because it expects a <code>public void</code> signature.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>For the record I'm actually trying to pass a long list of words for auto-complete purposes, so it won't be just a simple 'string'.</p>