0

I am using the Gecko Webbrowser control. What I do is to first click button1 to go to the first URL. This works fine!

Then I click button2 to go the almost the same URL. The only difference is that the date is different, 2019-09-26.

If I do that in google chrome, it works fine. But when I click button2 after I have landed on the URL with 2019-09-13 successfully. Nothing happens!

button2 doesn't navigate to the URL here. Why does chrome react when I paste that URL. I wonder if I need to reset any cache or something in the Gecko control before navigating somehow? I tried to navigate to https://www.google.com/ in button2 and that worked fine.

Any ideas would be so helpful!

Thank you!

private void button1_Click(object sender, EventArgs e)
{
       geckoWebBrowser1.Navigate("https://app.someurl.com/web?startDate=2019-09-13");
}
private void button2_Click(object sender, EventArgs e)
{
       geckoWebBrowser1.Navigate("https://app.someurl.com/web?startDate=2019-09-26");
}
private void geckoWebBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
{
    geckoWebBrowser1.Update();
}
Isma
  • 14,604
  • 5
  • 37
  • 51
Andreas
  • 1,121
  • 4
  • 17
  • 34

1 Answers1

0

Tested this and no problems. I created a simple php page to display the query string.

Windows 10 Home / Visual Studio 2019 Developer / Geckofx60.32 (from NuGet)

screenshot

public Form1()
{
    InitializeComponent();
}

private void Button1_Click(object sender, EventArgs e)
{
    geckoWebBrowser1.Navigate("http://localhost:81/?test=true");
}

private void Button2_Click(object sender, EventArgs e)
{
    geckoWebBrowser1.Navigate("http://localhost:81/?test=false");
}

private void GeckoWebBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
{
    geckoWebBrowser1.Update();
    textBox1.Text = geckoWebBrowser1.Url.ToString();
}

[STAThread]
static void Main()
{
    Xpcom.Initialize("Firefox");

    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1());
}

index.php

test = 
<?php echo $_GET["test"]; ?>
Hassan Voyeau
  • 3,383
  • 4
  • 22
  • 24