There is no way to track the creation of new frames and attach signals to them. A frame-created signal allows a developer to attach signals to all new frames.
Created attachment 63123 [details] Add frame-created signal and test
Comment on attachment 63123 [details] Add frame-created signal and test >+ g_signal_connect(webView, "frame-created", G_CALLBACK(createFrameSignalTestFrameCreatedCallback), loop); >+ >+ // We want to ensure that exactly two create-frame signals are >+ // fired and no more, so we set a timeout here. There does not appear >+ // to be a simple way via the API to figure out when all frames have >+ // loaded. >+ g_timeout_add(500, createFrameSignalTestTimeout, loop); webview::document-load-finished does not work? >+ >+ gtk_container_add(GTK_CONTAINER(window), webView); >+ gtk_widget_show(window); >+ gtk_widget_show(webView); >+ >+ webkit_web_view_load_string(WEBKIT_WEB_VIEW(webView), >+ "<html><body>Frames!" >+ "<iframe></iframe>" >+ "<iframe></iframe>" >+ "</body></html>", >+ "text/html", "utf-8", "file://"); >+ g_main_loop_run(loop); >+} >+ >+ /* >+ * WebKitWebView::frame-created >+ * @web_view: the object which received the signal >+ * @web_frame: the #WebKitWebFrame which was just created. >+ * >+ * Emitted when a WebKitWebView has created a new frame. This signal will >+ * be fired for all sub-frames created during page load. It will not be >+ * emitted for the main frame, which originates in the WebKitWebView constructor >+ * and may be accessed any time using webkit_web_view_get_main_frame. Missing a Since: Looks good otherwise.
(In reply to comment #2) > >+ g_timeout_add(500, createFrameSignalTestTimeout, loop); > webview::document-load-finished does not work? I tried a patch which counted document-load-finished signals, but that seemed to have bad interactions with the GLib main loop and libsoup. I wonder if it's exposing another bug. :/ > Missing a Since: Fixed!
Committed r64496: <http://trac.webkit.org/changeset/64496>