Class: Selenium::WebDriver::Firefox::Profile
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Firefox::Profile
- Defined in:
- lib/selenium/web_driver/firefox/profile.rb
Class Attribute Summary collapse
-
.firebug_version ⇒ Object
Returns the value of attribute firebug_version.
Instance Method Summary collapse
- #enable_firebug(version = nil) ⇒ Object
- #frame_position ⇒ Object
- #frame_position=(position) ⇒ Object
Class Attribute Details
.firebug_version ⇒ Object
Returns the value of attribute firebug_version.
6 7 8 |
# File 'lib/selenium/web_driver/firefox/profile.rb', line 6 def firebug_version @firebug_version end |
Instance Method Details
#enable_firebug(version = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/selenium/web_driver/firefox/profile.rb', line 23 def enable_firebug(version = nil) version ||= Selenium::WebDriver::Firefox::Profile.firebug_version add_extension(File.("../../../../bin/firebug-#{version}.xpi", __FILE__)) # For some reason, Firebug seems to trigger the Firefox plugin check # (navigating to https://www.mozilla.org/en-US/plugincheck/ at startup). # This prevents it. See http://code.google.com/p/selenium/issues/detail?id=4619. self['extensions.blocklist.enabled'] = false # Prevent "Welcome!" tab self['extensions.firebug.showFirstRunPage'] = false # Enable for all sites. self['extensions.firebug.allPagesActivation'] = 'on' # Enable all features. %w(console net script).each do |feature| self["extensions.firebug.#{feature}.enableSites"] = true end # Closed by default, will open detached. self['extensions.firebug.framePosition'] = frame_position self['extensions.firebug.previousPlacement'] = 3 self['extensions.firebug.defaultPanelName'] = 'console' # Disable native "Inspect Element" menu item. self['devtools.inspector.enabled'] = false self['extensions.firebug.hideDefaultInspector'] = true end |
#frame_position ⇒ Object
13 14 15 |
# File 'lib/selenium/web_driver/firefox/profile.rb', line 13 def frame_position @frame_position ||= 'detached' end |
#frame_position=(position) ⇒ Object
17 18 19 20 21 |
# File 'lib/selenium/web_driver/firefox/profile.rb', line 17 def frame_position=(position) @frame_position = %w(left right top detached).detect do |side| position && position[0].downcase == side[0] end || 'detached' end |