summaryrefslogtreecommitdiff
path: root/javascript/jsapi/window.bnd
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-02-07 18:16:37 +0000
committerVincent Sanders <vince@netsurf-browser.org>2013-02-07 18:16:37 +0000
commit4ffa39177deab3403faa8a187c668b722b50edfb (patch)
treec04b22f63a960491592392a2f81d850c281cf1f4 /javascript/jsapi/window.bnd
parent7957cc59b1d1270e6719989c8c1df7e9e20eec47 (diff)
downloadnetsurf-4ffa39177deab3403faa8a187c668b722b50edfb.tar.gz
netsurf-4ffa39177deab3403faa8a187c668b722b50edfb.tar.bz2
fix docuemnt/window location to correctly navigate, fixes http://www.avaaz.org/ base page
Diffstat (limited to 'javascript/jsapi/window.bnd')
-rw-r--r--javascript/jsapi/window.bnd21
1 files changed, 21 insertions, 0 deletions
diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd
index bba1eb7db..b334cc7cc 100644
--- a/javascript/jsapi/window.bnd
+++ b/javascript/jsapi/window.bnd
@@ -40,6 +40,27 @@ preamble %{
#include "window.h"
#include "location.h"
+struct browser_window *jsapi_get_browser_window(JSContext *cx);
+
+%}
+
+prologue %{
+
+struct browser_window *jsapi_get_browser_window(JSContext *cx)
+{
+ struct jsclass_private *private;
+
+ private = JS_GetInstancePrivate(cx,
+ JS_GetGlobalObject(cx),
+ &JSClass_Window,
+ NULL);
+ if (private != NULL) {
+ return private->bw;
+ }
+
+ return NULL;
+}
+
%}
binding window {