reverted 83472789 (refs #34) and added a new clear() method to stop javascript ex…
…ecution within the remote DOM environment
Showing
3 changed files
with
17 additions
and
2 deletions
... | @@ -4,6 +4,8 @@ CasperJS Changelog | ... | @@ -4,6 +4,8 @@ CasperJS Changelog |
4 | XXXX-XX-XX, v0.6.5 | 4 | XXXX-XX-XX, v0.6.5 |
5 | ------------------ | 5 | ------------------ |
6 | 6 | ||
7 | - **BC BREAK:** reverted 8347278 (refs [#34](https://github.com/n1k0/casperjs/issues/34) and added a new `clear()` method to *close* a page | ||
8 | You now have to call `casper.clear()` if you want to stop javascript execution within the remote DOM environment. | ||
7 | - fixed 0.6.4 version number in `bootstrap.js` | 9 | - fixed 0.6.4 version number in `bootstrap.js` |
8 | - centralized version number to package.json | 10 | - centralized version number to package.json |
9 | 11 | ... | ... |
... | @@ -213,7 +213,6 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) { | ... | @@ -213,7 +213,6 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) { |
213 | } else { | 213 | } else { |
214 | self.result.time = new Date().getTime() - self.startTime; | 214 | self.result.time = new Date().getTime() - self.startTime; |
215 | self.log(f("Done %s steps in %dms", self.steps.length, self.result.time), "info"); | 215 | self.log(f("Done %s steps in %dms", self.steps.length, self.result.time), "info"); |
216 | self.page.content = ''; // avoid having previously loaded DOM contents being still active (refs #34) | ||
217 | clearInterval(self.checker); | 216 | clearInterval(self.checker); |
218 | self.emit('run.complete'); | 217 | self.emit('run.complete'); |
219 | if (utils.isFunction(onComplete)) { | 218 | if (utils.isFunction(onComplete)) { |
... | @@ -230,6 +229,20 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) { | ... | @@ -230,6 +229,20 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) { |
230 | }; | 229 | }; |
231 | 230 | ||
232 | /** | 231 | /** |
232 | * Clears the current page execution environment context. Useful to avoid | ||
233 | * having previously loaded DOM contents being still active (refs #34). | ||
234 | * | ||
235 | * Think of it as a way to stop javascript execution within the remote DOM | ||
236 | * environment. | ||
237 | * | ||
238 | * @return Casper | ||
239 | */ | ||
240 | Casper.prototype.clear = function clear() { | ||
241 | this.page.content = ''; | ||
242 | return this; | ||
243 | }; | ||
244 | |||
245 | /** | ||
233 | * Emulates a click on the element from the provided selector using the mouse | 246 | * Emulates a click on the element from the provided selector using the mouse |
234 | * pointer, if possible. | 247 | * pointer, if possible. |
235 | * | 248 | * | ... | ... |
-
Please register or sign in to post a comment