fixed resources array is now reset adequately
reference discussion: https://groups.google.com/forum/?hl=fr?fromgroups#!topic/casperjs/TCkNzrj1IoA
Showing
2 changed files
with
5 additions
and
3 deletions
... | @@ -7,6 +7,7 @@ XXXX-XX-XX, v0.6.9 | ... | @@ -7,6 +7,7 @@ XXXX-XX-XX, v0.6.9 |
7 | - fixed [#114](https://github.com/n1k0/casperjs/issues/114) - ensured client-side utils are injected before any `evaluate()` call | 7 | - fixed [#114](https://github.com/n1k0/casperjs/issues/114) - ensured client-side utils are injected before any `evaluate()` call |
8 | - fixed [#117](https://github.com/n1k0/casperjs/issues/117) - `fill()` coulnd't `submit()` a form with a submit input named *submit* | 8 | - fixed [#117](https://github.com/n1k0/casperjs/issues/117) - `fill()` coulnd't `submit()` a form with a submit input named *submit* |
9 | - merged [#122](https://github.com/n1k0/casperjs/pull/122) - allow downloads to be triggered by more than just `GET` requests | 9 | - merged [#122](https://github.com/n1k0/casperjs/pull/122) - allow downloads to be triggered by more than just `GET` requests |
10 | - fixed loaded resources array is now reset adequately [reference discussion](https://groups.google.com/forum/?hl=fr?fromgroups#!topic/casperjs/TCkNzrj1IoA) | ||
10 | 11 | ||
11 | 2012-05-20, v0.6.8 | 12 | 2012-05-20, v0.6.8 |
12 | ------------------ | 13 | ------------------ | ... | ... |
... | @@ -746,6 +746,7 @@ Casper.prototype.open = function open(location, settings) { | ... | @@ -746,6 +746,7 @@ Casper.prototype.open = function open(location, settings) { |
746 | operation: settings.method, | 746 | operation: settings.method, |
747 | data: settings.data | 747 | data: settings.data |
748 | }, this.page.settings); | 748 | }, this.page.settings); |
749 | this.resources = []; | ||
749 | return this; | 750 | return this; |
750 | }; | 751 | }; |
751 | 752 | ||
... | @@ -775,17 +776,18 @@ Casper.prototype.resourceExists = function resourceExists(test) { | ... | @@ -775,17 +776,18 @@ Casper.prototype.resourceExists = function resourceExists(test) { |
775 | var testFn; | 776 | var testFn; |
776 | switch (utils.betterTypeOf(test)) { | 777 | switch (utils.betterTypeOf(test)) { |
777 | case "string": | 778 | case "string": |
778 | testFn = function _test(res) { | 779 | testFn = function _testResourceExists_String(res) { |
779 | return res.url.search(test) !== -1; | 780 | return res.url.search(test) !== -1; |
780 | }; | 781 | }; |
781 | break; | 782 | break; |
782 | case "regexp": | 783 | case "regexp": |
783 | testFn = function _test(res) { | 784 | testFn = function _testResourceExists_Regexp(res) { |
784 | return test.test(res.url); | 785 | return test.test(res.url); |
785 | }; | 786 | }; |
786 | break; | 787 | break; |
787 | case "function": | 788 | case "function": |
788 | testFn = test; | 789 | testFn = test; |
790 | testFn.name = "_testResourceExists_Function"; | ||
789 | break; | 791 | break; |
790 | default: | 792 | default: |
791 | throw new CasperError("Invalid type"); | 793 | throw new CasperError("Invalid type"); |
... | @@ -1299,7 +1301,6 @@ function createPage(casper) { | ... | @@ -1299,7 +1301,6 @@ function createPage(casper) { |
1299 | }; | 1301 | }; |
1300 | page.onLoadStarted = function onLoadStarted() { | 1302 | page.onLoadStarted = function onLoadStarted() { |
1301 | casper.loadInProgress = true; | 1303 | casper.loadInProgress = true; |
1302 | casper.resources = []; | ||
1303 | casper.emit('load.started'); | 1304 | casper.emit('load.started'); |
1304 | }; | 1305 | }; |
1305 | page.onLoadFinished = function onLoadFinished(status) { | 1306 | page.onLoadFinished = function onLoadFinished(status) { | ... | ... |
-
Please register or sign in to post a comment