Commit a03c6757 a03c6757610475c84acdac5bee7007d1a741a049 by Nicolas Perriault

reintroduced CasperUtils#exists, erroneously deleted on merge

1 parent e13b9169
Showing 1 changed file with 14 additions and 0 deletions
......@@ -546,6 +546,20 @@
};
/**
* Checks if a given DOM element exists in remote page.
*
* @param String selector CSS3 selector
* @return Boolean
*/
this.exists = function(selector) {
try {
return document.querySelectorAll(selector).length > 0;
} catch (e) {
return false;
}
};
/**
* Downloads a resource behind an url and returns its base64-encoded
* contents.
*
......