Exemplo n.º 1
0
    public ContentBlocker()
    {
        hlBlockedHosts = new HostList();

        string sList = FiddlerApplication.Prefs.GetStringPref("ext.ContentBlocker.BlockHosts", null);

        if (!String.IsNullOrEmpty(sList))
        {
            hlBlockedHosts.AssignFromString(sList);
        }

        InitializeMenu();
        miShortCircuitRedirects.Checked = FiddlerApplication.Prefs.GetBoolPref("ext.ContentBlocker.ShortcircuitRedirects", false);
        miBlockXDomainFlash.Checked     = FiddlerApplication.Prefs.GetBoolPref("ext.ContentBlocker.FlashBlockXDomain", true);
        miFlashAlwaysBlock.Checked      = FiddlerApplication.Prefs.GetBoolPref("ext.ContentBlocker.FlashBlockAlways", false);
        miLikelyPaths.Checked           = FiddlerApplication.Prefs.GetBoolPref("ext.ContentBlocker.BlockPathsByHeuristic", true);
        miHideBlockedSessions.Checked   = FiddlerApplication.Prefs.GetBoolPref("ext.ContentBlocker.HideBlocked", false);
    }
Exemplo n.º 2
0
        /// <summary>
        /// Create a Fiddler dialog with an editable textbox containing the server values
        /// </summary>
        public void EditBlockedServices()
        {
            string enteredHostValues = frmPrompt.GetUserString("Edit Blocked Host List", "Enter semicolon-delimited block list.", blockedHostList.ToString(), true);

            if (enteredHostValues == null)
            {
                return;
            }

            string errors;

            if (blockedHostList.AssignFromString(enteredHostValues, out errors))
            {
                ChangeStatusText("Successfully updated blocked host list.");
            }
            else
            {
                ReportError("Could not set new host values:" + errors);
            }
        }
Exemplo n.º 3
0
    private void miEditBlockedHosts_Click(object sender, System.EventArgs e)
    {
        string sNewList = frmPrompt.GetUserString("Edit Blocked Host List",
                                                  "Enter semicolon-delimited block list.", hlBlockedHosts.ToString(), true);

        if (null == sNewList)
        {
            FiddlerApplication.UI.sbpInfo.Text = "Block list left unchanged.";
            return;
        }
        else
        {
            string sErrors;
            if (!hlBlockedHosts.AssignFromString(sNewList, out sErrors))
            {
                MessageBox.Show(sErrors, "Error in list");
            }
            else
            {
                FiddlerApplication.UI.sbpInfo.Text = "Block list updated.";
            }
        }
    }