Method: Osascript::Safari.document_source_code

Defined in:
lib/osascript/Safari.rb

.document_source_codeObject

+options tab (for instance : options = ‘tab 2 of window 1’).

Returns:

  • the HTML source code of front document or of the



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/osascript/Safari.rb', line 85

def document_source_code
  options ||= {}
  where = options[:where] || 'front document'
  code = "  if count of window is 0\n    return null\n  else\n    return source of (\#{where})\n  end\n  CODE\n  Osascript::__asrun(code, 'Safari')\nend\n"