remove method:javascriptEnabled
* per review comments, remove unnecessary method:javascriptEnabled
Showing
1 changed file
with
2 additions
and
15 deletions
... | @@ -432,19 +432,6 @@ Casper.prototype.checkStarted = function checkStarted() { | ... | @@ -432,19 +432,6 @@ Casper.prototype.checkStarted = function checkStarted() { |
432 | }; | 432 | }; |
433 | 433 | ||
434 | /** | 434 | /** |
435 | * Checks if executing JavaScript in the Page is enabled. | ||
436 | * | ||
437 | * @return Boolean | ||
438 | */ | ||
439 | Casper.prototype.javascriptEnabled = function javascriptEnabled() { | ||
440 | "use strict"; | ||
441 | if (this.options.pageSettings.javascriptEnabled === false) { | ||
442 | return false; | ||
443 | } | ||
444 | return true; | ||
445 | }; | ||
446 | |||
447 | /** | ||
448 | * Clears the current page execution environment context. Useful to avoid | 435 | * Clears the current page execution environment context. Useful to avoid |
449 | * having previously loaded DOM contents being still active (refs #34). | 436 | * having previously loaded DOM contents being still active (refs #34). |
450 | * | 437 | * |
... | @@ -704,7 +691,7 @@ Casper.prototype.evaluate = function evaluate(fn, context) { | ... | @@ -704,7 +691,7 @@ Casper.prototype.evaluate = function evaluate(fn, context) { |
704 | "use strict"; | 691 | "use strict"; |
705 | this.checkStarted(); | 692 | this.checkStarted(); |
706 | // check whether javascript is enabled !! | 693 | // check whether javascript is enabled !! |
707 | if (!this.javascriptEnabled()) { | 694 | if (this.options.pageSettings.javascriptEnabled === false) { |
708 | throw new CasperError("evaluate() requires javascript to be enabled"); | 695 | throw new CasperError("evaluate() requires javascript to be enabled"); |
709 | } | 696 | } |
710 | // preliminary checks | 697 | // preliminary checks |
... | @@ -997,7 +984,7 @@ Casper.prototype.getCurrentUrl = function getCurrentUrl() { | ... | @@ -997,7 +984,7 @@ Casper.prototype.getCurrentUrl = function getCurrentUrl() { |
997 | "use strict"; | 984 | "use strict"; |
998 | this.checkStarted(); | 985 | this.checkStarted(); |
999 | try { | 986 | try { |
1000 | if (!this.javascriptEnabled()) { | 987 | if (this.options.pageSettings.javascriptEnabled === false) { |
1001 | return this.page.url; | 988 | return this.page.url; |
1002 | } else { | 989 | } else { |
1003 | return utils.decodeUrl(this.evaluate(function _evaluate() { | 990 | return utils.decodeUrl(this.evaluate(function _evaluate() { | ... | ... |
-
Please register or sign in to post a comment