Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

add support for basic auth #75

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 audits.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ webpage.viewportSize = {
height: opts.height
};

if (opts.username && opts.password) {
webpage.settings.userName = opts.username;
webpage.settings.password = opts.password;
}

webpage.onResourceTimeout = function (err) {
console.error('Error code:' + err.errorCode + ' ' + err.errorString + ' for ' + err.url);
phantom.exit(1);
Expand Down
2 changes: 2 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const cli = meow(`

Options
--viewport-size=<size> Set the viewport size
--username=<username> Set the basicauth username
--password=<password> Set the basicauth password
--delay Set the delay capturing the page
--verbose Display more information

Expand Down