aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-03-08 08:27:02 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-03-09 23:36:31 +0800
commitc825037c4440837ed53a98ef7d707ce567234a5a (patch)
treecf58baec0cb6da4d3c4746f78253f1e7ac1b8dbc /embed/ephy-web-view.c
parentab757b343a2e6f580777dccd72027aef486563dc (diff)
downloadgsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar.gz
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar.bz2
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar.lz
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar.xz
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.tar.zst
gsoc2013-epiphany-c825037c4440837ed53a98ef7d707ce567234a5a.zip
ephy-web-view: add js_get_element_property
This retrieves a property from a JS object, just like "element.property" in plain javascript. Bug #608740
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 129ee3bc7..398db35d8 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -583,6 +583,21 @@ js_object_get_property_as_object (JSContextRef js_context,
}
static char *
+js_get_element_property (JSContextRef js_context,
+ JSObjectRef object,
+ const char *prop)
+{
+ JSValueRef val;
+ char *buffer = NULL;
+
+ val = js_object_get_property (js_context, object, prop);
+ if (JSValueIsString (js_context, val))
+ buffer = js_value_to_string (js_context, val);
+
+ return buffer;
+}
+
+static char *
js_get_element_attribute (JSContextRef js_context,
JSObjectRef object,
const char *attr)