protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
        {
            try
            {
                bool newUrl = IsNavigatingToNewUrl(frame.Url);

                if (newUrl)
                {
                    this.url = frame.Url;
                    string strippedUrl = CommonFunctions.StrippedAmazonUrl(this.url);
                    string product     = CommonFunctions.AmazonProductFromUrl(strippedUrl);

                    if (strippedUrl != "www.amazon.com/" && strippedUrl != "http://www.amazon.com/" && strippedUrl != "https://www.amazon.com/")
                    {
                        ////Check if user is watching the current url as long as we aren't just on the amazon main page
                        if (DBHelper.IsWatchingUrl(CommonFunctions.ItemsConnectionString, product))
                        {
                            CommonFunctions.UpdatePriceWatchButton(true);
                        }
                        else
                        {
                            CommonFunctions.UpdatePriceWatchButton(false);
                        }
                    }
                    else
                    {
                        CommonFunctions.UpdatePriceWatchButton(false);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.Log.Error("Error checking url", ex);
            }


            //returning false allows the browser to continue navigating to the url, true cancels
            return(false);
        }
        private async void PriceWatch_Click(object sender, RoutedEventArgs e)
        {
            //verify we are on an amazon site
            if (urlAddress_txtbox.Text.Contains("amazon.co"))
            {
                if (!IsWatchingItem())
                {
                    NumericInputDialog priceInput = new Amazon_Price_Checker.NumericInputDialog("Enter your desired price:");
                    if (priceInput.ShowDialog() == true)
                    {
                        try
                        {
                            float.TryParse(priceInput.Answer.Trim(), out float desiredPrice);

                            if (desiredPrice > 0)
                            {
                                string itemTitle = string.Empty;
                                string itemPrice = string.Empty;

                                await Browser.EvaluateScriptAsync(@"document.getElementById('productTitle').innerHTML").ContinueWith(x =>
                                {
                                    var response = x.Result;

                                    if (response.Success && response.Result != null)
                                    {
                                        var result = response.Result;

                                        itemTitle = (string)result;
                                    }
                                });

                                await Browser.EvaluateScriptAsync(@"document.getElementById('price_inside_buybox').innerHTML").ContinueWith(x =>
                                {
                                    var response = x.Result;

                                    if (response.Success && response.Result != null)
                                    {
                                        var result = response.Result;

                                        itemPrice = (string)result;
                                    }
                                });

                                string url        = urlAddress_txtbox.Text.Trim();
                                float  itemPriceF = CommonFunctions.StringPriceToFloat(itemPrice.Trim());


                                bool itemInserted = DBHelper.InsertItem(CommonFunctions.ItemsConnectionString, CommonFunctions.RemoveSQLCharacters(itemTitle.Trim()), CommonFunctions.StrippedAmazonUrl(url), itemPriceF, desiredPrice);
                                CommonFunctions.Log.Debug($"Price watching {itemTitle} for {desiredPrice.ToString()}");
                                CommonFunctions.UpdatePriceWatchButton(itemInserted);

                                UpdateBrowserStatusText($"{itemTitle.Trim()} is now being watched", "There was an error watching this item at this time. Please try again later", itemInserted);

                                //Now update watch list tab
                                FillWatchList();
                            }
                            else
                            {
                                UpdateBrowserStatusText("", "Desired price must be greater than 0", false);
                            }
                        }
                        catch (Exception userPriceException)
                        {
                            CommonFunctions.Log.Error($"Error watching item {urlAddress_txtbox.Text.Trim()}", userPriceException);
                            UpdateBrowserStatusText("", "There was an error updating your desired price", false);
                        }
                    }
                }
                else
                {
                    NumericInputDialog priceInput = new Amazon_Price_Checker.NumericInputDialog("Enter your updated desired price:");
                    if (priceInput.ShowDialog() == true)
                    {
                        try
                        {
                            float.TryParse(priceInput.Answer.Trim(), out float desiredPrice);

                            if (desiredPrice > 0)
                            {
                                DataTable itemIdTable = DBHelper.GetItemID(CommonFunctions.ItemsConnectionString, CommonFunctions.AmazonProductFromUrl(CommonFunctions.StrippedAmazonUrl(urlAddress_txtbox.Text.Trim())));
                                if (itemIdTable.Rows.Count > 0)
                                {
                                    int  itemID  = Int32.Parse(itemIdTable.Rows[0]["ItemID"].ToString());
                                    bool updated = DBHelper.UpdateDesiredPrice(CommonFunctions.ItemsConnectionString, itemID, desiredPrice);

                                    UpdateBrowserStatusText("The desired price has been updated", "There was an error updating your desired price", updated);
                                    FillWatchList();
                                }
                            }
                        }
                        catch (Exception updateDesiredPriceException)
                        {
                            CommonFunctions.Log.Error($"Error updating desired price {urlAddress_txtbox.Text.Trim()}", updateDesiredPriceException);
                            UpdateBrowserStatusText("", "There was an error updating your desired price", false);
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Amazon items are the only items able to me monitored",
                                "Price Watch Error",
                                MessageBoxButton.OK,
                                MessageBoxImage.Exclamation);

                Browser.Address = "www.amazon.com";
            }
        }