summaryrefslogtreecommitdiff
path: root/desktop/browser.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-05-05 15:38:09 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-05-05 16:00:03 +0100
commit1146f8bf49eda7f23960e2efdd6dcefb6a98b552 (patch)
tree553805b6b0c41ff73f4fea712cb9169b69efbde0 /desktop/browser.c
parentf3892c98fdc734a0abca136ab712c94246fe66c0 (diff)
downloadnetsurf-1146f8bf49eda7f23960e2efdd6dcefb6a98b552.tar.gz
netsurf-1146f8bf49eda7f23960e2efdd6dcefb6a98b552.tar.bz2
Add browser_window_exec
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'desktop/browser.c')
-rw-r--r--desktop/browser.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 1c8aa95fa..d26abd043 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -3406,3 +3406,24 @@ int browser_get_dpi(void)
{
return FIXTOINT(nscss_screen_dpi);
}
+
+/* exported interface documented in browser.h */
+bool browser_window_exec(struct browser_window *bw, const char *src, size_t srclen)
+{
+ assert(bw != NULL);
+
+ if (!bw->current_content) {
+ NSLOG(netsurf, DEEPDEBUG, "Unable to exec, no content");
+ return false;
+ }
+
+ if (content_get_status(bw->current_content) != CONTENT_STATUS_DONE) {
+ NSLOG(netsurf, DEEPDEBUG, "Unable to exec, content not done");
+ return false;
+ }
+
+ /* Okay it should be safe, forward the request through to the content
+ * itself. Only HTML contents currently support executing code
+ */
+ return content_exec(bw->current_content, src, srclen);
+}