Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying configurations in order to accept User_Agent #594

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/wraith/helpers/save_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ def compare_label
def engine
wraith.engine
end

def selenium_options
wraith.selenium_options
end

end
3 changes: 3 additions & 0 deletions lib/wraith/save_images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def get_driver
'hide-scrollbars',
'ignore-certificate-errors'
].each { |arg| options.add_argument("--#{arg}") }
meta.selenium_options.each do |opt|
options.add_argument(opt)
end
Selenium::WebDriver.for :chrome, options: options
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/wraith/wraith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def engine
engine
end

def selenium_options
@config["selenium_options"].to_a
end

def snap_file
@config["snap_file"] ? convert_to_absolute(@config["snap_file"]) : snap_file_from_engine(engine)
end
Expand Down