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." | |||
| 191 | Argument XW webkit. | 191 | Argument XW webkit. |
| 192 | Argument STR string." | 192 | Argument STR string." |
| 193 | ;;TODO read out the string in the field first and provide for edit | 193 | ;;TODO read out the string in the field first and provide for edit |
| 194 | (interactive (list (xwidget-webkit-current-session) | 194 | (interactive |
| 195 | (read-string "string:"))) | 195 | (let* ((xww (xwidget-webkit-current-session)) |
| 196 | (field-value | ||
| 197 | (progn | ||
| 198 | (xwidget-webkit-execute-script xww "document.title=document.activeElement.value;") | ||
| 199 | (xwidget-webkit-get-title xww)))) | ||
| 200 | (list xww | ||
| 201 | (read-string "string:" field-value)))) | ||
| 196 | (xwidget-webkit-execute-script xw (format "document.activeElement.value='%s'" str))) | 202 | (xwidget-webkit-execute-script xw (format "document.activeElement.value='%s'" str))) |
| 197 | 203 | ||
| 198 | (defun xwidget-webkit-adjust-size-to-content () | 204 | (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 | |||
| 705 | //TODO support multibyte strings | 705 | //TODO support multibyte strings |
| 706 | struct xwidget* xw = XXWIDGET(xwidget); | 706 | struct xwidget* xw = XXWIDGET(xwidget); |
| 707 | const gchar* str=webkit_web_view_get_title( WEBKIT_WEB_VIEW(xw->widget_osr)); | 707 | const gchar* str=webkit_web_view_get_title( WEBKIT_WEB_VIEW(xw->widget_osr)); |
| 708 | return make_string_from_bytes(str, wcslen((const wchar_t *)str), strlen(str)); | 708 | //return make_string_from_bytes(str, wcslen((const wchar_t *)str), strlen(str)); |
| 709 | return build_string(str); | ||
| 709 | } | 710 | } |
| 710 | 711 | ||
| 711 | //TODO missnamed | 712 | //TODO missnamed |