예제 #1
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.GetArgumentValue(CefSharpArguments.CustomSchemeArgument);
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                schemes.Split(';').ToList().ForEach(x =>
                {
                    var tokens       = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName        = tokens[0],
                        IsStandard        = tokens[1] == "T",
                        IsLocal           = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T",
                        IsSecure          = tokens[4] == "T",
                        IsCorsEnabled     = tokens[5] == "T",
                        IsCSPBypassing    = tokens[6] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
예제 #2
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.FirstOrDefault(a => a.StartsWith(CefSharpArguments.CustomSchemeArgument));
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                //Remove the "--custom-scheme=" part of the argument
                schemes.Substring(CefSharpArguments.CustomSchemeArgument.Length + 1).Split(';').ToList().ForEach(x =>
                {
                    var tokens       = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName        = tokens[0],
                        IsStandard        = tokens[1] == "T",
                        IsLocal           = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T",
                        IsSecure          = tokens[4] == "T",
                        IsCorsEnabled     = tokens[5] == "T",
                        IsCSPBypassing    = tokens[6] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
예제 #3
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.GetArgumentValue(CefSharpArguments.CustomSchemeArgument);
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                schemes.Split(';').ToList().ForEach(x =>
                {
                    var tokens        = x.Split('|');
                    var schemeName    = tokens[0];
                    var schemeOptions = SchemeOptions.None;

                    Enum.TryParse(tokens[1], out schemeOptions);

                    var customScheme = new CefCustomScheme(schemeName, schemeOptions);

                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
예제 #4
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="scheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme scheme)
 {
     settings.RegisterScheme(scheme);
 }
예제 #5
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List<CefCustomScheme> ParseCommandLineArguments(IEnumerable<string> args)
        {
            var schemes = args.FirstOrDefault(a => a.StartsWith(CefSharpArguments.CustomSchemeArgument));
            var customSchemes = new List<CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                //Remove the "--custom-scheme=" part of the argument
                schemes.Substring(CefSharpArguments.CustomSchemeArgument.Length + 1).Split(';').ToList().ForEach(x =>
                {
                    var tokens = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName = tokens[0],
                        IsStandard = tokens[1] == "T",
                        IsLocal = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return customSchemes;
        }
예제 #6
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="cefCustomScheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme cefCustomScheme)
 {
     cefCustomSchemes.Add(cefCustomScheme);
 }
예제 #7
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="cefCustomScheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme cefCustomScheme)
 {
     cefCustomSchemes.Add(cefCustomScheme);
 }