class Selenium::WebDriver::Chrome::Profile

@private

Public Class Methods

new(model = nil) click to toggle source
# File lib/selenium/webdriver/chrome/profile.rb, line 12
def initialize(model = nil)
  @model = verify_model(model)
end

Public Instance Methods

[](key) click to toggle source
# File lib/selenium/webdriver/chrome/profile.rb, line 27
def [](key)
  parts = key.split(".")
  parts.inject(prefs) { |pr, k| pr.fetch(k) }
end
[]=(key, value) click to toggle source

Set a preference in the profile.

See codesearch.google.com/codesearch#OAMlx_jo-ck/src/chrome/common/pref_names.cc&exact_package=chromium

# File lib/selenium/webdriver/chrome/profile.rb, line 22
def []=(key, value)
  parts = key.split(".")
  parts[0..-2].inject(prefs) { |pr, k| pr[k] ||= {} }[parts.last] = value
end
layout_on_disk() click to toggle source
# File lib/selenium/webdriver/chrome/profile.rb, line 32
def layout_on_disk
  dir = @model ? create_tmp_copy(@model) : Dir.mktmpdir("webdriver-chrome-profile")
  FileReaper << dir

  write_prefs_to dir

  dir
end