static void reloadOrStopCallback(BrowserWindow *window) { if (webkit_web_view_is_loading(window->webView)) webkit_web_view_stop_loading(window->webView); else webkit_web_view_reload(window->webView); }
JNIEXPORT void JNICALL WebKitGTK_NATIVE(_1webkit_1web_1view_1stop_1loading) (JNIEnv *env, jclass that, jintLong arg0) { WebKitGTK_NATIVE_ENTER(env, that, _1webkit_1web_1view_1stop_1loading_FUNC); webkit_web_view_stop_loading((WebKitWebView *)arg0); WebKitGTK_NATIVE_EXIT(env, that, _1webkit_1web_1view_1stop_1loading_FUNC); }
static void finalize(webpopup_t *wp, int code) { webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(wp->wp_webview)); wp->wp_wr.wr_resultcode = code; LIST_INSERT_HEAD(&pending_close, wp, wp_link); }
void ChromeClient::closeWindowSoon() { // We may not have a WebView as create-web-view can return NULL. if (!m_webView) return; if (m_closeSoonTimer) // Don't call close-web-view more than once. return; // We need to remove the parent WebView from WebViewSets here, before it actually // closes, to make sure that JavaScript code that executes before it closes // can't find it. Otherwise, window.open will select a closed WebView instead of // opening a new one <rdar://problem/3572585>. m_webView->priv->corePage->setGroupName(""); // We also need to stop the load to prevent further parsing or JavaScript execution // after the window has torn down <rdar://problem/4161660>. webkit_web_view_stop_loading(m_webView); // Clients commonly destroy the web view during the close-web-view signal, but our caller // may need to send more signals to the web view. For instance, if this happened in the // onload handler, it will need to call FrameLoaderClient::dispatchDidHandleOnloadEvents. // Instead of firing the close-web-view signal now, fire it after the caller finishes. // This seems to match the Mac/Windows port behavior. m_closeSoonTimer = g_timeout_add(0, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView); }
void ghtml_stop(GtkWidget * widget) { GHtml * ghtml; ghtml = g_object_get_data(G_OBJECT(widget), "ghtml"); webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(ghtml->view)); }
static VALUE WebView_stop_loading(VALUE self) { WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self)); #line 138 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr" webkit_web_view_stop_loading(_self); return Qnil; }
static VALUE WebView_stop_loading(VALUE self) { WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self)); #line 297 "/home/ngl/Progetti/gtk-webkit-ruby/ext/webkit/webkit.cr" webkit_web_view_stop_loading(_self); return Qnil; }
void create_web_view_got_uri_cb (WebKitWebView* web_view, GParamSpec param_spec) { (void) web_view; (void) param_spec; webkit_web_view_stop_loading(web_view); const gchar* uri = webkit_web_view_get_uri(web_view); if (strncmp(uri, "javascript:", strlen("javascript:")) == 0) eval_js(uzbl.gui.web_view, (gchar*) uri + strlen("javascript:"), NULL, "javascript:"); else send_event(NEW_WINDOW, NULL, TYPE_STR, uri, NULL); }
void sc_abort(Browser *b, const Arg *arg) { /* stop loading website */ webkit_web_view_stop_loading(b->UI.view); /* reset to NORMAL mode */ browser_change_mode(b, NORMAL); /* hide inputbar */ gtk_widget_hide(GTK_WIDGET(b->UI.inputbar)); /* unmark search results */ webkit_web_view_unmark_text_matches(b->UI.view); gtk_widget_grab_focus(GTK_WIDGET(b->UI.scrolled_window)); }
bool cmd_stop(girara_session_t* session, girara_list_t* argument_list) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); jumanji_t* jumanji = (jumanji_t*) session->global.data; jumanji_tab_t* tab = jumanji_tab_get_current(jumanji); if (tab == NULL || tab->web_view == NULL) { return false; } webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(tab->web_view)); return true; }
void browser_destroy(Browser * b) { webkit_web_view_stop_loading(b->UI.view); /* block signal handler for b->UI.window:"destroy" - prevents infinite loop */ g_signal_handlers_block_by_func(G_OBJECT(b->UI.window), G_CALLBACK(cb_win_destroy), b); /* destroy elements */ gtk_widget_destroy(b->UI.window); /* remove from list of browsers */ ripcurl->Global.browsers = g_list_remove(ripcurl->Global.browsers, b); /* free data */ free(b); /* quit if no windows left */ if (g_list_length(ripcurl->Global.browsers) == 0) { gtk_main_quit(); } }
void ChromeClient::closeWindowSoon() { // We may not have a WebView as create-web-view can return NULL. if (!m_webView) return; webkit_web_view_stop_loading(m_webView); gboolean isHandled = false; g_signal_emit_by_name(m_webView, "close-web-view", &isHandled); if (isHandled) return; // FIXME: should we clear the frame group name here explicitly? Mac does it. // But this gets cleared in Page's destructor anyway. // webkit_web_view_set_group_name(m_webView, ""); }
static void test_webkit_web_data_source_lifetime() { WebKitWebView* view; GMainLoop* loop; view = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(view); loop = g_main_loop_new(NULL, TRUE); g_signal_connect(view, "notify::load-status", G_CALLBACK(notify_load_status_lifetime_cb), loop); webkit_web_view_load_uri(view, "http://www.webkit.org"); waitTimer = g_timeout_add_seconds(defaultTimeout, (GSourceFunc)wait_timer_fired, loop); g_main_loop_run(loop); WebKitWebDataSource* dataSource = webkit_web_frame_get_data_source(webkit_web_view_get_main_frame(view)); GList* subResources = webkit_web_data_source_get_subresources(dataSource); gint numberOfResources = g_list_length(subResources); g_list_free(subResources); g_assert_cmpint(webkit_web_view_get_load_status(view), ==, WEBKIT_LOAD_FINISHED); webkit_web_view_load_uri(view, "http://gnome.org"); g_assert_cmpint(webkit_web_view_get_load_status(view), ==, WEBKIT_LOAD_PROVISIONAL); webkit_web_view_stop_loading(view); g_assert_cmpint(webkit_web_view_get_load_status(view), ==, WEBKIT_LOAD_FAILED); subResources = webkit_web_data_source_get_subresources(dataSource); g_assert_cmpint(numberOfResources, ==, g_list_length(subResources)); g_list_free(subResources); if (waitTimer) g_source_remove(waitTimer); waitTimer = 0; g_main_loop_unref(loop); g_object_unref(view); }
static VbResult normal_navigate(Client *c, const NormalCmdInfo *info) { int count; WebKitBackForwardList *list; WebKitBackForwardListItem *item; WebKitWebView *view = c->webview; switch (info->key) { case CTRL('I'): /* fall through */ case CTRL('O'): count = info->count ? info->count : 1; if (info->key == CTRL('O')) { if (webkit_web_view_can_go_back(view)) { list = webkit_web_view_get_back_forward_list(view); item = webkit_back_forward_list_get_nth_item(list, -1 * count); webkit_web_view_go_to_back_forward_list_item(view, item); } } else { if (webkit_web_view_can_go_forward(view)) { list = webkit_web_view_get_back_forward_list(view); item = webkit_back_forward_list_get_nth_item(list, count); webkit_web_view_go_to_back_forward_list_item(view, item); } } break; case 'r': webkit_web_view_reload(view); break; case 'R': webkit_web_view_reload_bypass_cache(view); break; case CTRL('C'): webkit_web_view_stop_loading(view); break; } return RESULT_COMPLETE; }
static void load_commit_cb (WebKitWebView *page, WebKitWebFrame *frame, gpointer data) { AuthBrowser *browser = AUTH_BROWSER (data); AuthBrowserPrivate *priv = GET_PRIVATE (browser); const gchar *uri = webkit_web_frame_get_uri(frame); g_print ("%s\n", uri); if (!priv->stop_url) return; if (g_str_has_prefix (uri, priv->stop_url)) { webkit_web_view_stop_loading (page); auth_browser_hide (browser); if (priv->callback) priv->callback (priv->data, uri); } }
void wxWebViewWebKit::Stop() { webkit_web_view_stop_loading(m_web_view); }
void stop(GtkWidget* webViewX, gpointer button){ webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(webViewX)); }
static gboolean stop_load (gpointer data) { webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(data)); return FALSE; }
static void stop_callback (GtkAction *action, gpointer data) { webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view)); }
void wxWebViewWebKit::Stop() { webkit_web_view_stop_loading (WEBKIT_WEB_VIEW(web_view)); }
/** * This is for keypresses that apply to a particular WebKitPage, and as such * require a reference to the tab itself. */ gboolean juniper_events_tab_key_press(GtkWidget * widget, GdkEventKey * event, GtkVBox * tab) { WebKitWebView * page; page = juniper_tabs_page_for_tab(tab); if (event->state & GDK_MOD1_MASK) { if (event->keyval == GDK_Left) { /* <Alt><Left> goes back */ if (webkit_web_view_can_go_back(page)) { juniper_ui_status_bar_clear(); webkit_web_view_go_back(page); } else { juniper_ui_status_bar_update("At start of history."); } return TRUE; } else if (event->keyval == GDK_Right) { /* <Alt><Right> goes forward */ if (webkit_web_view_can_go_forward(page)) { juniper_ui_status_bar_clear(); webkit_web_view_go_forward(page); } else { juniper_ui_status_bar_update("At end of history."); } return TRUE; } else if (event->keyval == GDK_Home) { /* <Alt><Home> goes to the homepage */ juniper_tabs_navigate_to(tab, juniper_prefs_get("homepage")); return TRUE; } } else if (event->state & GDK_CONTROL_MASK) { if (event->keyval == GDK_r) { /* <Ctrl>R reloads the page */ webkit_web_view_reload(page); return TRUE; } } else if (event->state == 0) { if (event->keyval == GDK_Escape) { /* <Esc> stops loading the page */ webkit_web_view_stop_loading(page); return TRUE; } else if (event->keyval == GDK_F5) { /* <F5> reloads the page */ webkit_web_view_reload(page); return TRUE; } } return FALSE; }
void WebkitBrowser::on_button_stop () { webkit_web_view_stop_loading (WEBKIT_WEB_VIEW(webview)); load_finished (NULL, NULL); }
static void activateEntry(GtkWidget* entry, gpointer* gdata) { WebKitWebView* webView = g_object_get_data(G_OBJECT(entry), "webView"); const gchar* entry_str = gtk_entry_get_text(GTK_ENTRY(entry)); WebKitWebSettings* settings = webkit_web_view_get_settings( WEBKIT_WEB_VIEW(webView)); gfloat current_zoom = webkit_web_view_get_zoom_level(webView); gboolean fz = webkit_web_view_get_full_content_zoom(webView); if (entry_str[0] != 0) { if (strncmp(entry_str, "?", 1) == 0) { gchar* s = g_strdup(entry_str); s++; gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, search_str, s, NULL)); if ((startpage == TRUE) && (fz == TRUE) && (current_zoom != 1.0)) { fz = FALSE; webkit_web_view_set_full_content_zoom(webView, fz); GtkWidget* window = g_object_get_data(G_OBJECT(entry), "window"); setZbutton(window, fz); } } else if (strncmp(entry_str, "=", 1) == 0) { gchar* s = g_strdup(entry_str); s++; searchText(webView, s); return; } else if (strncmp(entry_str, "#", 1) == 0) { int r = 0; r = fork(); if (r == 0) { execl("/usr/local/bin/kwebhelper.py", "kwebhelper.py", "cmd", entry_str, NULL); } return; } else if (strncmp(entry_str, "!", 1) == 0) { gchar* s = g_strdup(entry_str); s++; if (strlen(s) > 1) { g_object_set(G_OBJECT(settings), "spell-checking-languages", s, NULL); gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "Spell checking language has been set to: ", s, NULL)); } return; } else if (strncmp(entry_str, "&", 1) == 0) { gchar* s = g_strdup(entry_str); s++; g_object_set(G_OBJECT(settings), "user-stylesheet-uri", s, NULL); gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "User style sheet: ", s, NULL)); return; } else if (strncmp(entry_str, "$", 1) == 0) { gchar* s = g_strdup(entry_str); s++; g_object_set(G_OBJECT(settings), "user-agent", s, NULL); const gchar* t = webkit_web_settings_get_user_agent(settings); gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "User agent: ", t, NULL)); return; } else if (strcmp(entry_str, ":c") == 0) { gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "file://", homedir, "/kweb_about_c.html", NULL)); } else if (strncmp(entry_str, ":", 1) == 0) { gchar* s = g_strdup(entry_str); s++; gchar* fname = g_strjoin(NULL, "/usr/local/share/kweb/kweb_about_", s, ".html", NULL); struct stat stbc; if (stat(fname, &stbc) == 0) { gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "file://", fname, NULL)); } else { gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "file:///usr/local/share/kweb/kweb_about_e.html", NULL)); } } else if (strstr(entry_str, "://") == NULL) { if (strncmp(entry_str, "/", 1) == 0) { gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "file://", entry_str, NULL)); } else { gtk_entry_set_text(GTK_ENTRY(entry), g_strjoin(NULL, "http://", entry_str, NULL)); } } const gchar* uri = gtk_entry_get_text(GTK_ENTRY(entry)); webkit_web_view_stop_loading(webView); webkit_web_view_load_uri(webView, uri); gtk_widget_grab_focus(GTK_WIDGET(webView)); } }
static void loadUri(WebKitWebView* webView, gchar* uri) { webkit_web_view_stop_loading(webView); webkit_web_view_load_uri(webView, uri); }
static int gtkWebBrowserSetStopAttrib(Ihandle* ih, const char* value) { webkit_web_view_stop_loading((WebKitWebView*)ih->handle); (void)value; return 0; /* do not store value in hash table */ }
static void goBack(GtkWidget* item, WebKitWebView* webView) { webkit_web_view_stop_loading(webView); webkit_web_view_go_back(webView); }
static void stopLoading(GtkWidget* item, WebKitWebView* webView) { webkit_web_view_stop_loading(webView); }
gboolean key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data) { struct Client *c = (struct Client *)data; gdouble dx, dy; gchar *f; gfloat z; WebKitWebContext *wc = webkit_web_view_get_context(WEBKIT_WEB_VIEW(c->web_view)); if (event->type == GDK_KEY_PRESS) { if (((GdkEventKey *)event)->state & GDK_MOD1_MASK) { switch (((GdkEventKey *)event)->keyval) { case GDK_KEY_q: /* close window (left hand) */ gtk_widget_destroy(c->win); return TRUE; case GDK_KEY_w: /* home (left hand) */ f = ensure_uri_scheme(home_uri); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(c->web_view), f); g_free(f); return TRUE; case GDK_KEY_e: /* new tab (left hand) */ f = ensure_uri_scheme(home_uri); client_new(f); g_free(f); return TRUE; case GDK_KEY_r: /* reload (left hand) */ webkit_web_view_reload_bypass_cache(WEBKIT_WEB_VIEW( c->web_view)); return TRUE; case GDK_KEY_d: /* download manager (left hand) */ gtk_widget_show_all(dm.win); return TRUE; case GDK_KEY_2: /* search forward (left hand) */ case GDK_KEY_n: /* search forward (maybe both hands) */ search(c, 1); return TRUE; case GDK_KEY_3: /* search backward (left hand) */ search(c, -1); return TRUE; case GDK_KEY_l: /* location (BOTH hands) */ gtk_widget_grab_focus(c->location); return TRUE; case GDK_KEY_k: /* initiate search (BOTH hands) */ gtk_widget_grab_focus(c->location); gtk_entry_set_text(GTK_ENTRY(c->location), "/"); gtk_editable_set_position(GTK_EDITABLE(c->location), -1); return TRUE; case GDK_KEY_c: /* reload trusted certs (left hand) */ trust_user_certs(wc); return TRUE; } } /* navigate backward (left hand) */ else if (((GdkEventKey *)event)->keyval == GDK_KEY_F2) { webkit_web_view_go_back(WEBKIT_WEB_VIEW(c->web_view)); return TRUE; } /* navigate forward (left hand) */ else if (((GdkEventKey *)event)->keyval == GDK_KEY_F3) { webkit_web_view_go_forward(WEBKIT_WEB_VIEW(c->web_view)); return TRUE; } else if (((GdkEventKey *)event)->keyval == GDK_KEY_Escape) { webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(c->web_view)); gtk_level_bar_set_value(GTK_LEVEL_BAR(c->progress), 0); } } else if (event->type == GDK_BUTTON_PRESS) { switch (((GdkEventButton *)event)->button) { case 2: if (c->hover_uri != NULL) { client_new(c->hover_uri); return TRUE; } break; case 8: webkit_web_view_go_back(WEBKIT_WEB_VIEW(c->web_view)); return TRUE; case 9: webkit_web_view_go_forward(WEBKIT_WEB_VIEW(c->web_view)); return TRUE; } } else if (event->type == GDK_SCROLL) { if (((GdkEventScroll *)event)->state & GDK_MOD1_MASK || ((GdkEventScroll *)event)->state & GDK_CONTROL_MASK) { gdk_event_get_scroll_deltas(event, &dx, &dy); z = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(c->web_view)); z += -dy * 0.1; z = dx != 0 ? global_zoom : z; webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(c->web_view), z); return TRUE; } } return FALSE; }
void stop(GtkWidget* widget, gpointer* wid) { web[count] = GTK_WIDGET(wid); webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(web[count])); }