With the following code:
#include <webkit2/webkit-web-extension>
/* Skipping through a lot of code */
{
JSCValue* result = jsc_context_evalutate(jsCtx, "document.getElementsByTagName('body')", -1);
std::cout << jsc_value_to_string(jsc_value_object_get_property_at_index(result, 0)) << "\n";
if (jsc_value_object_is_instance_of(result, "HTMLBodyElement"))
std::cout << "Instance of HTMLBodyElement\n";
}
I get [object HTMLBodyElement]
printed but not Instance of HTMLBodyElement
. I have a few questions about this.
- How can I get the class of a JSCValue without having to check it?
- Why is the current check not working?
- How can I access other properties of the object? When I tried to increase the index, all I got was undefined and when I used
jsc_value_object_enumerate_properties()
I only got one address in memory. My goal is to access the CSS, Tag, ID/Class, parent elements, and children elements. I do not know how I can turn a char** into usable information.