Example #1
0
        private void LoadURL(string url)
        {
            Uri    outUri;
            string newUrl   = url;
            string urlLower = url.Trim().ToLower();

            // UI
            SetTabTitle(CurBrowser, "Loading...");



            // load page
            if (urlLower == "localhost")
            {
                newUrl = "http://localhost/";
            }
            else if (url.CheckIfFilePath() || url.CheckIfFilePath2())
            {
                newUrl = url.PathToURL();
            }
            else
            {
                Uri.TryCreate(url, UriKind.Absolute, out outUri);

                if (!(urlLower.StartsWith("http") || urlLower.StartsWith("sharpbrowser")))
                {
                    if (outUri == null || outUri.Scheme != Uri.UriSchemeFile)
                    {
                        newUrl = "http://" + url;
                    }
                }

                if (urlLower.StartsWith("sharpbrowser:") ||

                    // load URL if it seems valid
                    (Uri.TryCreate(newUrl, UriKind.Absolute, out outUri) &&
                     ((outUri.Scheme == Uri.UriSchemeHttp || outUri.Scheme == Uri.UriSchemeHttps) && newUrl.Contains(".") || outUri.Scheme == Uri.UriSchemeFile)))
                {
                }
                else
                {
                    // run search if unknown URL
                    newUrl = SearchURL + HttpUtility.UrlEncode(url);
                }
            }

            // load URL
            CurBrowser.Load(newUrl);

            // set URL in UI
            SetFormURL(newUrl);

            // always enable back btn
            EnableBackButton(true);
            EnableForwardButton(false);
        }
Example #2
0
        private void LoadURL(string url)
        {
            Uri    outUri;
            string newUrl   = url;
            string urlLower = url.Trim().ToLower();

            // UI
            SetTabTitle(CurBrowser, "Loading...");

            // load page
            if (urlLower == "localhost")
            {
                newUrl = "about:blank";
            }
            else if (url.CheckIfFilePath() || url.CheckIfFilePath2())
            {
                newUrl = url.PathToURL();
            }
            else
            {
                Uri.TryCreate(url, UriKind.Absolute, out outUri);

                if (!(urlLower.StartsWith("http") || urlLower.StartsWith("sharpbrowser")))
                {
                    if (outUri == null || outUri.Scheme != Uri.UriSchemeFile)
                    {
                        newUrl = "http://" + url;
                    }
                }
            }


            // load URL
            CurBrowser.Load(newUrl);

            // set URL in UI
            SetFormURL(newUrl);
        }
Example #3
0
 private void citationGeneratorToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("https://www.citefast.com/");
 }
Example #4
0
 private void googleSlidesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("https://www.google.com/intl/en-GB/slides/about/");
 }
Example #5
0
 private void canvaToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://canva.com");
 }
Example #6
0
 private void facebookToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.facebook.com");
 }
Example #7
0
 private void whatsappWebToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://web.whatsapp.com");
 }
Example #8
0
 private void edxToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.edx.org");
 }
Example #9
0
 private void googleClassroomToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://classroom.google.com");
 }
Example #10
0
 private void foxNewsToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.foxnews.com");
 }
Example #11
0
 private void timesOfIsraelToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.timesofisrael.com");
 }
Example #12
0
 private void jerusalemPostToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.jpost.com");
 }
Example #13
0
 private void gulfTimesQatarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.gulf-times.com/");
 }
Example #14
0
 private void gitHubToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.github.com");
 }
Example #15
0
 private void collegeBoardToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("https://www.collegeboard.org/");
 }
Example #16
0
 private void toolStripStatusLabel1_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load(AdulteryURL);
 }
Example #17
0
 private void khanAcademyToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://khanacademy.org");
 }
Example #18
0
 private void alJazeeraToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.aljazeera.com");
 }
Example #19
0
 private void codecademyToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.codecademy.com");
 }
Example #20
0
 private void googleDriveToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://drive.google.com");
 }
Example #21
0
 private void grammarlyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.grammarly.com");
 }
Example #22
0
 private void googleFormsToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("https://www.google.com/forms/about/");
 }
Example #23
0
 private void instagramToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.instagram.com");
 }
Example #24
0
 private void BtnHome_Click(object sender, EventArgs e)
 {
     CurBrowser.Load(HomepageURL);
 }
Example #25
0
 private void twitterToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.twitter.com");
 }
Example #26
0
 private void russiaTodayToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.rt.com");
 }
Example #27
0
 private void preziToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.prezi.com");
 }
Example #28
0
 private void googleDocsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurBrowser.Load("http://docs.google.com");
 }
Example #29
0
 public void RefreshActiveTab()
 {
     CurBrowser.Load(CurBrowser.Address);
 }
Example #30
0
 private void weeblyToolStripMenuItem_Click_2(object sender, EventArgs e)
 {
     CurBrowser.Load("http://www.weebly.com");
 }