   metaKeyName = 'Ctrl'
   metaKeyName = 'Cmd'  if /^Mac/.test navigator.platform
 
-  getContent = () ->
-    if $editorCode[0].innerText?
+  getDomContent = () ->
+    if 'innerText' of $editorCode[0]
       $editorCode[0].innerText
     else
       content = $editorCode[0].innerHTML
       content = content.replace /<br>/gi, '\n'
       he.decode content
 
-  setContent = (content) ->
-    if $editorCode[0].innerText?
+  setDomContent = (content) ->
+    if 'innerText' of $editorCode[0]
       $editorCode[0].innerText = content
     else
       content = content.replace

      method
      url
      contentType: 'application/octet-stream'
      data
    }).always(always).done(done).fail(fail)
    false

  edit = (content) ->
    content ?= getContent()
    $linenosCode.html "#{metaKeyName}+s to Save - Shift+#{metaKeyName}+s to Save As...".replace /(.)/g, '$1<br>'
    $editorCode.html(content).attr('contentEditable', 'true').focus()
    $editor.addClass('editing')

    $(window).on 'keydown', maybeSave

  lock = (content, lines = []) ->
    content ?= getDomContent()
    if Array.isArray lines
      if lines.length is 0
        linenosCount = content.split('\n').length
