summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-10-31 09:23:56 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-10-31 09:23:56 +0000
commit78067fc29a89452a08a10d6b907f81e4ce77fbb9 (patch)
tree8591311c2371a9ee41004e0955dc0739e13d8015
parent396b445599731cceb7173bdc2336ccc1e59871a7 (diff)
downloadnetsurf-78067fc29a89452a08a10d6b907f81e4ce77fbb9.tar.gz
netsurf-78067fc29a89452a08a10d6b907f81e4ce77fbb9.tar.bz2
Log window.alert() messages.
-rw-r--r--Docs/UnimplementedJavascript.txt1
-rw-r--r--javascript/duktape/Window.bnd8
2 files changed, 8 insertions, 1 deletions
diff --git a/Docs/UnimplementedJavascript.txt b/Docs/UnimplementedJavascript.txt
index 7af3f16ea..133b8f554 100644
--- a/Docs/UnimplementedJavascript.txt
+++ b/Docs/UnimplementedJavascript.txt
@@ -1727,7 +1727,6 @@ getter WheelEvent::deltaX(double);\n
getter WheelEvent::deltaY(double);\n
getter WheelEvent::deltaZ(double);\n
method WheelEvent::initWheelEvent();\n
-method Window::alert();\n
getter Window::applicationCache(user);\n
method Window::atob();\n
method Window::blur();\n
diff --git a/javascript/duktape/Window.bnd b/javascript/duktape/Window.bnd
index a6355fb2c..4d3c0ec7c 100644
--- a/javascript/duktape/Window.bnd
+++ b/javascript/duktape/Window.bnd
@@ -132,3 +132,11 @@ setter Window::name()
browser_window_set_name(priv->win, name);
return 0;
%}
+
+method Window::alert()
+%{
+ duk_size_t msg_len;
+ const char *msg = duk_safe_to_lstring(ctx, 0, &msg_len);
+ LOG("JS ALERT: %*s", (int)msg_len, msg);
+ return 0;
+%}