diff options
-rw-r--r-- | lisp/xwidget.el | 10 | ||||
-rw-r--r-- | src/xwidget.c | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 97dbe11fed9..3b3aba4b98f 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -191,8 +191,14 @@ defaults to the string looking like a url around the cursor position." Argument XW webkit. Argument STR string." ;;TODO read out the string in the field first and provide for edit - (interactive (list (xwidget-webkit-current-session) - (read-string "string:"))) + (interactive + (let* ((xww (xwidget-webkit-current-session)) + (field-value + (progn + (xwidget-webkit-execute-script xww "document.title=document.activeElement.value;") + (xwidget-webkit-get-title xww)))) + (list xww + (read-string "string:" field-value)))) (xwidget-webkit-execute-script xw (format "document.activeElement.value='%s'" str))) (defun xwidget-webkit-adjust-size-to-content () diff --git a/src/xwidget.c b/src/xwidget.c index e667c4c75fd..89cd859fdfc 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -705,7 +705,8 @@ DEFUN ("xwidget-webkit-get-title", Fxwidget_webkit_get_title, Sxwidget_webkit_g //TODO support multibyte strings struct xwidget* xw = XXWIDGET(xwidget); const gchar* str=webkit_web_view_get_title( WEBKIT_WEB_VIEW(xw->widget_osr)); - return make_string_from_bytes(str, wcslen((const wchar_t *)str), strlen(str)); + //return make_string_from_bytes(str, wcslen((const wchar_t *)str), strlen(str)); + return build_string(str); } //TODO missnamed |