Esempio n. 1
0
        // Handle all the button clicks (Panel).
        private void CommonClickHandler(object sender, EventArgs e)
        {
            if (sender.GetType() != typeof(Panel)) // only accept panels..
            {
                return;
            }

            Panel btn = (sender as Panel);

            if (btn.Equals(btnCloseBrowser)) // if the close button was clicked..
            {
                Close();                     // .. do close the form
            }
            else if (btn.Equals(btnRefresh)) // if the wind forward was clicked..
            {
                browser.Reload();
            }
            else if (btn.Equals(btnBack))
            {
                browser.GoBack();
            }
            else if (btn.Equals(btnForward))
            {
                browser.GoForward();
            }
            else if (btn.Equals(btnBrowserHome))
            {
                browser.Navigate(startURL);
            }
        }
Esempio n. 2
0
 private void toolStripButton_Back_Click(object sender, EventArgs e)
 {
     if (browser.CanGoBack)
     {
         browser.GoBack();
     }
 }
        public void Navigating_NavigationError_Chrome()
        {
            int errorCount = 0, completeCount = 0;

            browser.DocumentCompleted += (sender, e) => ++ completeCount;
            browser.NavigationError   += (sender, e) => ++ errorCount;

            browser.Navigate("chrome://global/content/bindings/general.xml"); //good url
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 0 && completeCount == 1);
            errorCount = completeCount = 0;

            browser.Navigate("chrome://global/content/aaaa"); //not found
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 1 && completeCount == 0);
            errorCount = completeCount = 0;

            Assert.True(browser.CanGoBack);
            browser.GoBack();
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 0 && completeCount == 1);
            errorCount = completeCount = 0;

            Assert.True(browser.CanGoForward);
            browser.GoForward();
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 1 && completeCount == 0);
            errorCount = completeCount = 0;

            browser.Navigate("chrome://global/bindings/general.xml"); //missing 'content' part
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 1 && completeCount == 0);
            errorCount = completeCount = 0;

            browser.Navigate("chrome://global/content/bindings/general.xml");
            browser.Stop();
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 1 && completeCount == 0);
            errorCount = completeCount = 0;

            browser.Navigate("chrome://global/content/bindings/general.xml");
            browser.Navigating += (sender, e) => e.Cancel = true;
            browser.NavigateFinishedNotifier.BlockUntilNavigationFinished();
            Assert.True(errorCount == 1 && completeCount == 0);
            errorCount = completeCount = 0;
        }
 private void GoBackToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         browser.GoBack();
     }
     catch (Exception ex) { }
 }
Esempio n. 5
0
        /// <summary>
        /// Invoke "go back" in browser history
        /// </summary>
        public void Back()
        {
            CheckDisposed();

            try
            {
                m_browser.GoBack();
            }
            catch
            {
                m_browser.Refresh();
            }
        }
 private void GoBackToolStripMenuItem_Click(object sender, EventArgs e)
 {
     browser.GoBack();
 }
Esempio n. 7
0
 private void BackButton_Click(object sender, EventArgs e)
 {
     geckoWebBrowser.GoBack();
     geckoWebBrowser.HistoryGoBack += GeckoWebBrowser_HistoryGoBack;
     //UrlTextBox.Text = geckoWebBrowser.url;
 }
 private void B_Forward_Click(object sender, RoutedEventArgs e)
 {
     browser.GoBack();
 }