summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-03-24 19:01:29 +0100
committerportix <portix@gmx.net>2014-03-24 19:01:29 +0100
commitb07751d84d485bc0d807a8838f93793be5edb652 (patch)
treef3e1384309d05772eda9c3900acfb30eadd5f4c4
parentd2d53a5ac33c46c98c9c10831f439a5058c2baab (diff)
downloaddwb-b07751d84d485bc0d807a8838f93793be5edb652.zip
Adding webview.loadDeferred
-rw-r--r--src/scripts.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/scripts.c b/src/scripts.c
index 9e0a1c3d..f4437893 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -1414,6 +1414,23 @@ wv_last_search(JSContextRef ctx, JSObjectRef object, JSStringRef js_name, JSValu
}
return NIL;
}/*}}}*/
+/**
+ * Whether the webview has already loaded the first site. loadDeferred can only
+ * be false if 'load-on-focus' is set to true
+ *
+ * @name loadDeferred
+ * @memberOf WebKitWebView.prototype
+ * @type Boolean
+ * */
+static JSValueRef
+wv_load_deferred(JSContextRef ctx, JSObjectRef object, JSStringRef js_name, JSValueRef* exception) {
+ GList *gl = find_webview(object);
+ gboolean deferred = false;
+ if (gl != NULL) {
+ deferred = VIEW(gl)->status->deferred;
+ }
+ return JSValueMakeBoolean(ctx, deferred);
+}
/* wv_get_main_frame {{{*/
/**
* The main frame
@@ -6993,6 +7010,7 @@ create_global_object()
{ 0, 0, 0 },
};
JSStaticValue wv_values[] = {
+ { "loadDeferred", wv_load_deferred, NULL, kJSDefaultAttributes },
{ "lastSearch", wv_last_search, NULL, kJSDefaultAttributes },
{ "hasSelection", wv_has_selection, NULL, kJSDefaultAttributes },
{ "mainFrame", wv_get_main_frame, NULL, kJSDefaultAttributes },