コード例 #1
0
 internal static void RaiseOnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     if (OnBeforeCommandLineProcessing != null)
     {
         OnBeforeCommandLineProcessing.Invoke(e);
     }
 }
コード例 #2
0
 private static void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     Console.WriteLine("ChromiumWebBrowser_OnBeforeCommandLineProcessing");
     e.CommandLine.AppendSwitchWithValue("disable-gpu", "1");
     e.CommandLine.AppendSwitchWithValue("disable-gpu-compositing", "1");
     Console.WriteLine(e.CommandLine.CommandLineString);
 }
コード例 #3
0
        /// <summary>
        /// 在浏览器命令行处理之前执行事件
        /// </summary>
        /// <param name="sender">传递对象</param>
        /// <param name="e">浏览器命令行处理事件参数</param>
        private void ChromiumFx_OnBeforeCommandLineProcessing(object sender, CfxOnBeforeCommandLineProcessingEventArgs e)
        {
            e.CommandLine.AppendSwitch("disable-gpu");

            //Uses WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is to use Chromium's network stack to fetch, and V8 to evaluate.
            //https://peter.sh/experiments/chromium-command-line-switches/#winhttp-proxy-resolver
            e.CommandLine.AppendSwitch("--winhttp-proxy-resolver");

            //Don't use a proxy server, always make direct connections. Overrides any other proxy server flags that are passed.
            //https://peter.sh/experiments/chromium-command-line-switches/#no-proxy-server
            e.CommandLine.AppendSwitch("--no-proxy-server");

            //Don't enforce the same-origin policy. (Used by people testing their sites.)
            //禁用跨域安全检测 & 关闭同源策略
            e.CommandLine.AppendSwitch("--disable-web-security");

            //PepperFlash\manifest.json中的version
            e.CommandLine.AppendSwitchWithValue("ppapi-flash-version", "19.0.0.207");
            e.CommandLine.AppendSwitchWithValue("ppapi-flash-path", $@"{_basePath}\PepperFlash\pepflashplayer.dll");
            //使用系统 Flash
            //e.CommandLine.AppendSwitch("--enable-system-flash");

#if DEBUG
            Console.WriteLine("ChromiumWebBrowser_OnBeforeCommandLineProcessing");
            Console.WriteLine(e.CommandLine.CommandLineString);
#endif
        }
コード例 #4
0
        internal static void EventCall(object sender, CfxOnBeforeCommandLineProcessingEventArgs e)
        {
            var call = new CfxOnBeforeCommandLineProcessingBrowserProcessCall();

            call.sender      = RemoteProxy.Wrap((CfxBase)sender);
            call.eventArgsId = AddEventArgs(e);
            call.RequestExecution(RemoteClient.connection);
            RemoveEventArgs(call.eventArgsId);
        }
コード例 #5
0
 private void PrivateUpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
     beforeLineCommand.CommandLine.AppendSwitch("disable-gpu");
     if (DisableWebSecurity)
     {
         beforeLineCommand.CommandLine.AppendSwitch("disable-web-security");
     }
     UpdateLineCommandArg(beforeLineCommand);
 }
コード例 #6
0
        internal static void RaiseOnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
        {
            var handler = OnBeforeCommandLineProcessing;

            if (handler != null)
            {
                handler(e);
            }
        }
コード例 #7
0
        internal static void on_before_command_line_processing(IntPtr gcHandlePtr, IntPtr process_type_str, int process_type_length, IntPtr command_line, out int command_line_release)
        {
            var self = (CfxApp)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                command_line_release = 1;
                return;
            }
            var e = new CfxOnBeforeCommandLineProcessingEventArgs(process_type_str, process_type_length, command_line);

            self.m_OnBeforeCommandLineProcessing?.Invoke(self, e);
            e.m_isInvalid        = true;
            command_line_release = e.m_command_line_wrapped == null? 1 : 0;
        }
コード例 #8
0
        private static void initCommandlineArgs(CfxOnBeforeCommandLineProcessingEventArgs e)
        {
            //
            //					//e.CommandLine.AppendSwitch ("multi-threaded-message-loop");
            ////					e.CommandLine.AppendSwitch ("off-screen-rendering-enabled");
            //					e.CommandLine.AppendSwitch("renderer-cmd-prefix");


            //e.CommandLine.AppendSwitch("disable-text-input-focus-manager");
            //e.CommandLine.AppendSwitch("no-zygote");
            //e.CommandLine.AppendSwitchWithValue("type","utility");
            //e.CommandLine.AppendSwitch("use-views");

            e.CommandLine.AppendArgument("--disable-gpu");
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: Denisov111/ChromeDevTools
 static void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     Console.WriteLine("ChromiumWebBrowser_OnBeforeCommandLineProcessing");
     Console.WriteLine(e.CommandLine.CommandLineString);
     e.CommandLine.AppendSwitchWithValue("proxy-server", "http://193.42.126.143:8000");
     e.CommandLine.AppendSwitchWithValue("enable-features", "NetworkService");
     if (proxy != null)
     {
         e.CommandLine.AppendSwitchWithValue("enable-features", "NetworkService");
         e.CommandLine.AppendSwitchWithValue("proxy-server", proxy);
         //e.CommandLine.AppendSwitchWithValue("proxy-server", "http://119.191.79.46:80");
     }
     //e.CommandLine.AppendSwitchWithValue("proxy-server", "http://193.42.126.143:8000");
     arguments += " " + e.CommandLine.CommandLineString;
     //e.CommandLine.AppendSwitchWithValue("proxy-server", "http://119.191.79.46:80");
     //e.CommandLine.AppendSwitchWithValue("persist-session-cookies", "1");
 }
コード例 #10
0
ファイル: HtmlUILauncher.cs プロジェクト: WildGenie/NanUI-1
        private static void SetFlashSupport(CfxOnBeforeCommandLineProcessingEventArgs args)
        {
            var flashSupportPath = System.IO.Path.Combine(CfxRuntime.LibCefDirPath, "PepperFlash");
            var manifestPath     = System.IO.Path.Combine(flashSupportPath, "manifest.json");
            var libPath          = System.IO.Path.Combine(flashSupportPath, "pepflashplayer.dll");

            if (!System.IO.File.Exists(manifestPath) || !System.IO.File.Exists(libPath))
            {
                return;
            }

            var match = System.Text.RegularExpressions.Regex.Match(System.IO.File.ReadAllText(manifestPath), @"""version"":.""(?<version>.+?)""");

            if (match.Success)
            {
                var version = match.Groups["version"].Value;

                args.CommandLine.AppendSwitchWithValue("ppapi-flash-version", version);
                args.CommandLine.AppendSwitchWithValue("ppapi-flash-path", libPath);
            }
        }
コード例 #11
0
        internal static void on_before_command_line_processing(IntPtr gcHandlePtr, IntPtr process_type_str, int process_type_length, IntPtr command_line)
        {
            var self = (CfxApp)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                return;
            }
            var e            = new CfxOnBeforeCommandLineProcessingEventArgs(process_type_str, process_type_length, command_line);
            var eventHandler = self.m_OnBeforeCommandLineProcessing;

            if (eventHandler != null)
            {
                eventHandler(self, e);
            }
            e.m_isInvalid = true;
            if (e.m_command_line_wrapped == null)
            {
                CfxApi.cfx_release(e.m_command_line);
            }
        }
コード例 #12
0
 private void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
 }
コード例 #13
0
ファイル: App.xaml.cs プロジェクト: zengfr/Neutronium
 protected override void UpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
     beforeLineCommand.CommandLine.AppendSwitch("disable-web-security");
 }
コード例 #14
0
 static void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     Console.WriteLine("ChromiumWebBrowser_OnBeforeCommandLineProcessing");
     Console.WriteLine(e.CommandLine.CommandLineString);
 }
コード例 #15
0
 private void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     _CommandLineHandler?.Invoke(e);
 }
コード例 #16
0
ファイル: App.xaml.cs プロジェクト: mRowlinson27/DndMarkII
 //These do nothing
 protected override void UpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
 }
コード例 #17
0
ファイル: CfxAppRemoteCalls.cs プロジェクト: xmcy0011/NanUI
 internal static void EventCall(object sender, CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     var call = new CfxOnBeforeCommandLineProcessingBrowserProcessCall();
     call.sender = RemoteProxy.Wrap((CfxBase)sender);
     call.eventArgsId = AddEventArgs(e);
     call.RequestExecution(RemoteClient.connection);
     RemoveEventArgs(call.eventArgsId);
 }
コード例 #18
0
 private void PrivateUpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
     beforeLineCommand.CommandLine.AppendSwitch("disable-gpu");
     UpdateLineCommandArg(beforeLineCommand);
 }
コード例 #19
0
 internal OnCSBeforeCfxCommandLineEventArgs(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     CommandLineProcessing = e;
 }
コード例 #20
0
 private void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
 }
コード例 #21
0
 /// <summary>
 /// 执行浏览器命令行处理之前执行回调事件
 /// </summary>
 /// <param name="e">浏览器命令行处理事件参数</param>
 internal static void RaiseOnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     OnBeforeCommandLineProcessing?.Invoke(null, e);
 }
コード例 #22
0
 private void ChromiumWebBrowser_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
 {
     _CommandLineHandler?.Invoke(e);
 }
コード例 #23
0
 protected virtual void UpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
 }
コード例 #24
0
 protected virtual void UpdateLineCommandArg(CfxOnBeforeCommandLineProcessingEventArgs beforeLineCommand)
 {
 }