Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            m_wke = new WebView();  //构造函数可以是无参,但是后面必须调用 Bind 方法
            m_wke.Bind(pictureBox); //随便绑定一个控件或窗口
        }
Esempio n. 2
0
        public Main()
        {
            InitializeComponent();

            m_wke = new WebView(); //构造函数可以是无参,但是后面必须调用 Bind 方法
            m_wke.Bind(this);      //随便绑定一个控件或窗口
        }
 public MiniBlinkWebView()
 {
     InitializeComponent();
     m_wke = new WebView();        //构造函数可以是无参,但是后面必须调用 Bind 方法
     m_wke.Bind(bowser_container); //随便绑定一个控件或窗口
     m_wke.OnLoadUrlBegin  += M_wke_OnLoadUrlBegin;
     m_wke.OnLoadUrlEnd    += M_wke_OnLoadUrlEnd;
     m_wke.OnLoadingFinish += M_wke_OnLoadingFinish;
 }
Esempio n. 4
0
        private void Main_Load(object sender, EventArgs e)
        {
            m_wView = new WebView();
            m_wView.Bind(panel_bs);
            //m_wView.LoadHTML(GetDemoHtml());
            m_wView.LoadURL("192.168.0.206/HtmlDemo.html");

            m_wView.BindFunction("JsFunc1", new wkeJsNativeFunction(JsFunc1));
            m_wView.BindFunction("JsFunc2", new wkeJsNativeFunction(JsFunc2));
            m_wView.BindFunction("JsFunc3", new wkeJsNativeFunction(JsFunc3));
        }
Esempio n. 5
0
        private void WebForm2_Load(object sender, EventArgs e)
        {
            m_WebView = new WebView();
            m_WebView.Bind(this);
            m_WebView.SetDeviceParameter("screen.width", string.Empty, this.Width);
            m_WebView.NavigationToNewWindowEnable = false;

            m_WebView.OnURLChange     += m_WebView_OnURLChange;
            m_WebView.OnLoadingFinish += m_WebView_OnLoadingFinish;
            m_WebView.OnLoadUrlBegin  += m_WebView_OnLoadUrlBegin;

            m_WebView.LoadURL(Url);
        }
Esempio n. 6
0
 private void TrackerForm_Load(object sender, EventArgs e)
 {
     Loaded = true;
     ApplyLanguage();
     try
     {
         if (!WebView.Bind(pictureBox1))
         {
             return;
         }
     }
     catch (Exception)
     {
         if (File.Exists("node.dll"))
         {
             File.Delete("node.dll");
         }
         if (File.Exists($@"{Environment.GetEnvironmentVariable("windir")}\node.dll"))
         {
             File.Delete($@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
         }
         Log.Debug("Debug:删除已过期组件 node.dll");
         if (File.Exists($"node_{Global.NODE_NEED}.dll"))
         {
             File.Move($"node_{Global.NODE_NEED}.dll", $@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
             Settings.NodeVersion = Global.NODE_NEED;
         }
         else if (File.Exists($@"{Environment.GetEnvironmentVariable("windir")}\node_{Global.NODE_NEED}.dll"))
         {
             File.Move($@"{Environment.GetEnvironmentVariable("windir")}\node_{Global.NODE_NEED}.dll", $@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
             Settings.NodeVersion = Global.NODE_NEED;
         }
         else
         {
             Settings.NodeVersion = 0;
         }
         Settings.Save();
         mainForm.tracker_disable();
         mainForm.ShowNotification("notification-dll-invalid", "node.dll", Localization.GetText("ui-settings-tracker"));
         return;
     }
     WebView.OnDocumentReady += OnDocumentReady;
     WebView.OnURLChange     += OnURLChange;
     WebView.OnAlertBox      += OnAlertBox;
     WebView.OnConfirmBox    += OnConfirmBox;
 }
Esempio n. 7
0
        private void WebForm_Load(object sender, EventArgs e)
        {
            m_WebView = new WebView();
            m_WebView.Bind(this);

            m_WebView.SetDeviceParameter("screen.width", string.Empty, this.Width);
            m_WebView.NavigationToNewWindowEnable = false;

            m_WebView.OnLoadUrlBegin  += m_WebView_OnLoadUrlBegin;
            m_WebView.OnLoadUrlEnd    += m_WebView_OnLoadUrlEnd;
            m_WebView.OnLoadingFinish += m_WebView_OnLoadingFinish;
            m_WebView.OnDocumentReady += m_WebView_OnDocumentReady;
            //m_WebView.OnURLChange += m_WebView_OnURLChange;
            m_WebView.OnNetResponse        += m_WebView_OnNetResponse;
            m_WebView.OnMouseoverUrlChange += m_WebView_OnMouseoverUrlChange;
            //m_WebView.onImageBufferToDataURL += WebView_OnImageBufferToDataURL;
            m_WebView.LoadURL(Url);
            //测试绑定JsFunction
            //JsValue.BindFunction("OnBtnClick", new wkeJsNativeFunction(OnBtnClick), 0);
        }
Esempio n. 8
0
        public ChromeWindow(Dictionary <string, string> cookies)
        {
            InitializeComponent();
            try
            {
                _mWke = new WebView();
                _mWke.Bind(PictureBox);
                _mWke.OnLoadingFinish += M_wke_OnLoadingFinish;

                Title = $@"{_mWke.Name} {_mWke.GetUserAgent()}";

                ClearCookie();
                _cookies = cookies;

                _mWke.LoadURL(@"https://passport.bilibili.com/login");
            }
            catch
            {
                _mWke = null;
                MessageBox.Show(@"加载失败");
                Loaded += (o, e) => { DialogResult = false; };
            }
        }