diff options
| author | Po Lu | 2021-11-07 19:51:39 +0800 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-11-07 14:14:43 +0100 |
| commit | cbc14f9b4eb95268417d5baebd18b55fc70da7f1 (patch) | |
| tree | efdfaeaede909b26a0bb004bf3d2d1a1051ccbfd /src | |
| parent | e31086fe1a5305cbe62e26772adc878a1c451e0d (diff) | |
| download | emacs-cbc14f9b4eb95268417d5baebd18b55fc70da7f1.tar.gz emacs-cbc14f9b4eb95268417d5baebd18b55fc70da7f1.zip | |
Handle WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION appropriately
* src/xwidget.c (webkit_decide_policy_cb): Send an xwidget display
event when a webpage asks to create a new window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwidget.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 66d84ee25a5..fb4619ee34d 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -1196,6 +1196,33 @@ webkit_decide_policy_cb (WebKitWebView *webView, | |||
| 1196 | break; | 1196 | break; |
| 1197 | } | 1197 | } |
| 1198 | case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: | 1198 | case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: |
| 1199 | { | ||
| 1200 | WebKitNavigationPolicyDecision *navigation_decision = | ||
| 1201 | WEBKIT_NAVIGATION_POLICY_DECISION (decision); | ||
| 1202 | WebKitNavigationAction *navigation_action = | ||
| 1203 | webkit_navigation_policy_decision_get_navigation_action (navigation_decision); | ||
| 1204 | WebKitURIRequest *request = | ||
| 1205 | webkit_navigation_action_get_request (navigation_action); | ||
| 1206 | WebKitWebView *newview; | ||
| 1207 | struct xwidget *xw = g_object_get_data (G_OBJECT (webView), XG_XWIDGET); | ||
| 1208 | Lisp_Object val, new_xwidget; | ||
| 1209 | |||
| 1210 | XSETXWIDGET (val, xw); | ||
| 1211 | |||
| 1212 | new_xwidget = Fmake_xwidget (Qwebkit, Qnil, make_fixnum (0), | ||
| 1213 | make_fixnum (0), Qnil, | ||
| 1214 | build_string (" *detached xwidget buffer*"), | ||
| 1215 | val); | ||
| 1216 | |||
| 1217 | if (NILP (new_xwidget)) | ||
| 1218 | return FALSE; | ||
| 1219 | |||
| 1220 | newview = WEBKIT_WEB_VIEW (XXWIDGET (new_xwidget)->widget_osr); | ||
| 1221 | webkit_web_view_load_request (newview, request); | ||
| 1222 | |||
| 1223 | store_xwidget_display_event (XXWIDGET (new_xwidget)); | ||
| 1224 | return TRUE; | ||
| 1225 | } | ||
| 1199 | case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: | 1226 | case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: |
| 1200 | { | 1227 | { |
| 1201 | WebKitNavigationPolicyDecision *navigation_decision = | 1228 | WebKitNavigationPolicyDecision *navigation_decision = |