.TP
.B LoadCommited
Fired if first data chunk has arrived, meaning that the necessary transport
-requirements are stabilished, and the load is being performed. This is the
+requirements are established, and the load is being performed. This is the
right event to toggle content related setting like 'scripts', 'plugins' and
such things.
.TP
.TP
.B LoadFinished
Fires when everything that was required to display on the page has been loaded.
-.PD
.TP
.B LoadFailed
Fired when some error occurred during the page load that prevented it from
being completed.
+.TP
+.B DownloadStart
+Fired right before a download is started. This is fired for vimb downloads as
+well as external downloads if 'download-use-external' is enabled.
+.TP
+.B DownloadFinished
+Fired if a vimb managed download is finished. For external download this event
+is not available.
+.TP
+.B DownloadFailed
+Fired if a vimb managed download failed. For external download this event
+is not available.
+.PD
.RE
.TP
.I pat
const char *name;
guint bits;
} events[] = {
- {"*", 0x001f},
- {"LoadProvisional", 0x0001},
- {"LoadCommited", 0x0002},
- {"LoadFirstLayout", 0x0004},
- {"LoadFinished", 0x0008},
- {"LoadFailed", 0x0010},
+ {"*", 0x00ff},
+ {"LoadProvisional", 0x0001},
+ {"LoadCommited", 0x0002},
+ {"LoadFirstLayout", 0x0004},
+ {"LoadFinished", 0x0008},
+ {"LoadFailed", 0x0010},
+ {"DownloadStart", 0x0020},
+ {"DownloadFinished", 0x0040},
+ {"DownloadFailed", 0x0080},
};
extern VbCore vb;
AU_PAGE_LOAD_FIRST_LAYOUT,
AU_PAGE_LOAD_FINISHED,
AU_PAGE_LOAD_FAILED,
+ AU_DOWNLOAD_START,
+ AU_DOWNLOAD_FINISHED,
+ AU_DOWNLOAD_FAILED,
} AuEvent;
void autocmd_init(void);
file = util_build_path(path, vb.config.download_dir);
}
+#ifdef FEATURE_AUTOCMD
+ autocmd_run(NULL, AU_DOWNLOAD_START, webkit_download_get_uri(download));
+#endif
if (use_external && *download_cmd) {
/* run download with external program */
vb_download_external(view, download, file);
file += 7;
}
if (status != WEBKIT_DOWNLOAD_STATUS_FINISHED) {
+#ifdef FEATURE_AUTOCMD
+ autocmd_run(NULL, AU_DOWNLOAD_FAILED, webkit_download_get_uri(download));
+#endif
vb_echo(VB_MSG_ERROR, false, "Error downloading %s", file);
} else {
+#ifdef FEATURE_AUTOCMD
+ autocmd_run(NULL, AU_DOWNLOAD_FINISHED, webkit_download_get_uri(download));
+#endif
vb_echo(VB_MSG_NORMAL, false, "Download %s finished", file);
}