From 3d075bec32d2ee74013918cbe03bbb2dec5f4d0c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 31 Jan 2013 20:28:49 +0000 Subject: add href location setter --- javascript/jsapi/location.bnd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'javascript') diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index 85117a2ce..3edbf9ecc 100644 --- a/javascript/jsapi/location.bnd +++ b/javascript/jsapi/location.bnd @@ -61,6 +61,20 @@ getter href %{ } %} +setter href %{ + JSString *url_jsstr = NULL; + int url_len = 0; + char *url = NULL; + + url_jsstr = JS_ValueToString(cx, vp); + if (url_jsstr != NULL) { + JSString_to_char(url_jsstr, url, url_len); + browser_window_go(private->htmlc->bw, url, NULL, false); + } else { + JSLOG("failed to convert string value"); + } +%} + getter protocol %{ lwc_string *component; component = nsurl_get_component(private->url, NSURL_SCHEME); -- cgit v1.2.3