/* * Copyright (c) 2010-2013 Stefan Bolte * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include "dwb.h" gboolean dom_add_frame_listener(WebKitWebFrame *frame, const char *signal, GCallback callback, gboolean bubble, GList *gl) { char *framesrc, *tagname; gboolean ret = false; WebKitDOMDOMWindow *win; WebKitDOMNode *node; WebKitWebView *wv = webkit_web_frame_get_web_view(frame); WebKitDOMDocument *doc = webkit_web_view_get_dom_document(wv); const char *src = webkit_web_frame_get_uri(frame); if (g_strcmp0(src, "about:blank")) { /* We have to find the correct frame, but there is no access from the web_frame * to the Htmlelement */ WebKitDOMNodeList *frames = webkit_dom_document_query_selector_all(doc, "iframe, frame", NULL); for (guint i=0; i