Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.
Open
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ ghostdriver.Session = function(desiredCapabilities) {
},
_windows = {}, //< NOTE: windows are "webpage" in Phantom-dialect
_currentWindowHandle = null,
_cookieJar = require('cookiejar').create(),
_cookieJar,
_cookiePath = null,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default should be an empty string to be consistent with the phantomjs source. though i'd prefer to be conservative and pass no arguments when this option is not used.

_id = require("./third_party/uuid.js").v1(),
_inputs = ghostdriver.Inputs(),
_capsPageSettingsPref = "phantomjs.page.settings.",
Expand All @@ -139,6 +140,12 @@ ghostdriver.Session = function(desiredCapabilities) {
_log = ghostdriver.logger.create("Session [" + _id + "]"),
k, settingKey, headerKey, proxySettings;

if (desiredCapabilities['phantomjs.cookies.path']) {
_cookiePath = desiredCapabilities['phantomjs.cookies.path'];
_negotiatedCapabilities['phantomjs.cookies.path'] = _cookiePath;
}
_cookieJar = require('cookiejar').create(_cookiePath);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default case should be the same. require('cookiejar').create()


var
/**
* Parses proxy JSON object and return proxy settings for phantom
Expand Down