anchor.diff:     * properties.
      */
     Future _injectScriptIntoWebviewMainWorld(String script) {
  -    script = script.replaceAll('"', r'\"')
  -                   .replaceAll("'", r"\'")
  -                   .replaceAll('\n', r'\n');
  +    // Escape all special charachters and enclose in double-quotes.
  +    script = JSON.encode('(function() { $script; })()');
       return _executeScriptInWebview(r'''
           (function() {
             var scriptTag = document.createElement('script');
  -          scriptTag.innerHTML = '(function() { ''' + script + r'''; })()';
  +          scriptTag.innerHTML = ''' + script + r''';
             document.body.appendChild(scriptTag);
           })();
       ''');
  
positive.code: import 'dart:async';
  import 'dart:html';
  import 'dart:js' as js;
  
  import 'package:chrome/chrome_app.dart' as chrome;
  import 'package:polymer/polymer.dart';
  
negative.code:       return new Timer(new Duration(milliseconds: 500), () {
          // The request is received and handled by the JS proxy script injected
          // into [_webview>] by [_injectDesignerProxy].
          return _executeScriptInWebview(r'''
              window.postMessage(
                  {action: 'import_code', code: ''' + code + r'''}, '*');
          ''');
        });
      });
  