Permalink
Browse files

Merge pull request #48 from bnoguchi/multi-host

Added documentation comment to Browser#hostBrowser.
  • Loading branch information...
2 parents 6fb8c86 + e7d32da commit 81d654b16baee14539961b5e5ef0f2615811b6bb @rauchg rauchg committed Jul 1, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/browser.js
View
@@ -116,6 +116,15 @@ Browser.prototype.context = function(selector, fn){
return this;
};
+/**
+ * Finds or creates/caches a Browser instance associated with the port
+ * and hostname of `uri`. If a new Browser is created, then the source
+ * Browser's User-Agent (if it is set) is copied to the new Browser.
+ *
+ * @param {Object} uri is an object returned from `require('url').parse(someUrl)`
+ * @return {Browser} the Browser associated with uri
+ * @api public
+ */
Browser.prototype.hostBrowser = function(uri) {
var otherHostname = uri.hostname
, port = uri.port || (uri.protocol === 'https:' ? 443 : (this.port || 80))

0 comments on commit 81d654b

Please sign in to comment.