Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
webdriver-user-agent
Advanced tools
A helper gem to emulate populate device user agents and resolutions when using webdriver
Add this line to your application's Gemfile:
gem 'webdriver-user-agent'
And then execute:
$ bundle
Or install it yourself as:
$ gem install webdriver-user-agent
provides a UserAgent.driver method to return a new web-driver with user agent and screen resolution mimicking a mobile device.
require 'selenium-webdriver'
require 'webdriver-user-agent'
driver = Webdriver::UserAgent.driver(:browser => :chrome, :agent => :iphone, :orientation => :landscape)
driver.get 'http://tiffany.com'
driver.current_url.should == 'http://m.tiffany.com/International.aspx'
require 'selenium-webdriver'
require 'webdriver-user-agent'
driver = Webdriver::UserAgent.driver(:agent => :random)
driver.execute_script('return navigator.userAgent')
# random agent like "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1"
require 'watir'
require 'webdriver-user-agent'
driver = Webdriver::UserAgent.driver(:browser => :chrome, :agent => :iphone, :orientation => :landscape)
browser = Watir::Browser.new(driver)
browser.goto 'tiffany.com'
browser.url.should == 'http://m.tiffany.com/International.aspx'
In our testing, it doesn't work well. Sometimes Safari Technology Preview works better, sometimes only Safari works at all. And as of May 2021, our ability to write user agent strings and languages for either flavor of Safari seems not to work on macOS Big Sur/Safari 14.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that webdriver-user-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.