private void ShopBrowser_NativeViewInitialized(object sender, WebViewEventArgs e) { JSObject jsHook = ShopBrowser.CreateGlobalJavascriptObject("parentSandboxBridge"); foreach (string x in jsHook.GetMethodNames()) Client.Log(x, "JSHook"); jsHook.Bind("openInventoryBrowser", false, OnItemClick); jsHook.Bind("getBuddyList", true, OnRequestBuddies); }
private void OnPageLoadFinished(IntPtr data, string pageUrl) { WebViewEventArgs e = new WebViewEventArgs(); e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView; e.PageUrl = pageUrl; if (pageLoadFinishedEventHandler != null) { pageLoadFinishedEventHandler(this, e); } }
private void ShopBrowser_NativeViewInitialized(object sender, WebViewEventArgs e) { JSObject JSHook = ShopBrowser.CreateGlobalJavascriptObject("parentSandboxBridge"); foreach (String x in JSHook.GetMethodNames()) { Client.Log(x, "JSHook"); } JSHook.Bind("openInventoryBrowser", false, OnItemClick); JSHook.Bind("getBuddyList", true, OnRequestBuddies); }
void Web_ProcessCreated(object sender, WebViewEventArgs e) { controller = new SongDisplayController(Control.Web, SongDisplayController.FeatureLevel.None); controller.ShowChords = showChords; controller.SongLoaded += (s, args) => { OnFinishedLoading(); }; (Control.Web.Surface as ImageSurface).Updated += web_Updated; controller.Load(this.song); }
private void webBrowser_NativeViewInitialized(object sender, WebViewEventArgs e) { webBrowser.LoadHTML("<html><body><h3>Loading...</h3></body></html>"); string userscopes = Scopes.Aggregate(string.Empty, (current, scope) => current + (EnumHelper.GetUserScope(scope) + " ")); userscopes = userscopes.Remove(userscopes.Length - 1, 1); webBrowser.Source = new Uri( "https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=a8t13c4i3clujv1irur7rfpu3u1weuz&redirect_uri=http://xim.schucreations.com&scope=" + userscopes); }
private void webControl_NativeViewInitialized(object sender, WebViewEventArgs e) { // We demonstrate the creation of a child global object. // Acquire the parent first. JSObject external = webControl.CreateGlobalJavascriptObject("external"); if (external == null) { return; } // NativeViewInitialized is not called in a Javascript Execution Context (JEC). // We explicitly dispose any created or acquired JSObjects. using ( external ) { // Create a child using fully qualified name. This only succeeds if // the parent is created first. JSObject app = webControl.CreateGlobalJavascriptObject("external.app"); if (app == null) { return; } using ( app ) { // Create and bind to an asynchronous custom method that will be called // by JavaScript, when the page is ready to provide us with a response // after performing some time consuming operation. // (See: /web/index.html) app.BindAsync("sendResponse", OnResponse); // Create and bind to an asynchronous custom method that is called // by JavaScript to have our native app perform some heavy, time consuming // work and provide a response asynchronously through a callback. // (See: /web/index.html) app.BindAsync("performHeavyWork", OnWork); } } }
private void ShopBrowser_NativeViewInitialized(object sender, WebViewEventArgs e) { JSObject JSHook = ShopBrowser.CreateGlobalJavascriptObject("parentSandboxBridge"); JSHook.Bind("openInventoryBrowser", false, new JavascriptMethodEventHandler(OnItemClick)); }
private void ShopBrowser_NativeViewInitialized(object sender, WebViewEventArgs e) { JSObject JSHook = ShopBrowser.CreateGlobalJavascriptObject("parentSandboxBridge"); JSHook.Bind("openInventoryBrowser", false, new JavascriptMethodEventHandler(OnItemClick)); JSHook.Bind("getBuddyList", true, new JavascriptMethodEventHandler(OnRequestBuddies)); }
private void Awesomium_Windows_Forms_WebControl_NativeViewInitialized(object sender, WebViewEventArgs e) { JSValue result = webControl1.CreateGlobalJavascriptObject("Launcher"); if (result.IsObject) { JSObject appObject = result; appObject.BindAsync("GetInstances", JS_GetInstances); appObject.BindAsync("Add3rdPartyLaunchable", JS_Add3rdPartyLaunchable); appObject.Bind("Quit", JS_Quit); appObject.Bind("Navigate", JS_Navigate); appObject.Bind("NavigateBack", JS_NavigateBack); appObject.BindAsync("LogIn", JS_LogIn); appObject.Bind("ActivateItem", JS_ActivateItem); appObject.Bind("SelectFile", JS_SelectFile); appObject.Bind("SaveModSort", JS_SaveModSort); appObject.Bind("ToggleFullscreen", JS_ToggleFullscreen); appObject.BindAsync("GetPatches", JS_GetPatches); appObject.Bind("CreateInstance", JS_CreateInstance); //JSObject zoomObj = new JSObject(); //appObject["Zoom"] = zoomObj; appObject.Bind("Zoom_SetModeNone", JS_Zoom_SetModeNone); appObject.Bind("Zoom_SetModeFull", JS_Zoom_SetModeFull); appObject.Bind("Zoom_SetModeHeight", JS_Zoom_SetModeHeight); appObject.Bind("Zoom_SetModeWidth", JS_Zoom_SetModeWidth); appObject.Bind("Zoom_SetTargetWidth", JS_Zoom_SetTargetWidth); appObject.Bind("Zoom_SetTargetHeight", JS_Zoom_SetTargetHeight); } }
private void Awesomium_Windows_Forms_WebControl_InitializeView(object sender, WebViewEventArgs e) { webControl1.WebSession = session; }
protected virtual void InitializeJavascript(object sender, WebViewEventArgs e) { const string functions = @" function findPos(obj) { var curleft = 0; var curtop = 0; if(obj.offsetLeft) curleft += parseInt(obj.offsetLeft); if(obj.offsetTop) curtop += parseInt(obj.offsetTop); if(obj.scrollTop && obj.scrollTop > 0) curtop -= parseInt(obj.scrollTop); if(obj.offsetParent) { var pos = findPos(obj.offsetParent); curleft += pos[0]; curtop += pos[1]; } else if(obj.ownerDocument) { var thewindow = obj.ownerDocument.defaultView; if(!thewindow && obj.ownerDocument.parentWindow) thewindow = obj.ownerDocument.parentWindow; if(thewindow) { if(thewindow.frameElement) { var pos = findPos(thewindow.frameElement); curleft += pos[0]; curtop += pos[1]; } } } return [curleft,curtop]; } function findPosById(id){ return findPos(document.getElementById(id)); } function objToString(obj){ var ret=''; for(var prop in obj){ ret+= prop + '=\'' + obj[prop] + '\', '; } return ret; } function objArrayToString(arr){ var ret=[]; for(var i=0;i<arr.length;i++){ ret[i]=objToString(arr[i]); } return ret; } "; BrowserThread.ExecuteAction(() => _view.ExecuteJavascript(functions) ); }
private void webChat_InitializeView(object sender, WebViewEventArgs e) { // Create a WebSession. WebSession session = WebCore.CreateWebSession(new WebPreferences() { SmoothScrolling = true, UniversalAccessFromFileURL = true }); // Assign it to the control. This should only occur here, before the // the underlying view of the control is created. webChat.WebSession = session; }
private void webControl_NativeViewInitialized(object sender, WebViewEventArgs e) { // We demonstrate the creation of a child global object. // Acquire the parent first. JSObject external = webControl.CreateGlobalJavascriptObject("external"); if (external == null) return; using (external) { // Create a child using fully qualified name. This only succeeds if // the parent is created first. JSObject app = webControl.CreateGlobalJavascriptObject("external.app"); if (app == null) return; using (app) { // Create and bind to an asynchronous custom method. This is called // by JavaScript to have the native app perform some heavy work. // (See: /web/index.html) app.Bind("startGame", false, StartGame); app.Bind("startBrowser", false, StartBrowser); } } }
void OnWebProcessCreated(object sender, WebViewEventArgs e) { if (Song != null) { Load(); } }
private void webControl_NativeViewInitialized(object sender, WebViewEventArgs e) { }
private void OnNativeViewInitialized(object sender, WebViewEventArgs e) { // The native view is created. You can create global JavaScript objects // at this point. These objects persist throughout the lifetime of the view // and are available to all pages loaded by this view. }
private void webViewStream_NativeViewInitialized(object sender, WebViewEventArgs e) { var navigationInterceptor = webViewStream.GetService(typeof (INavigationInterceptor)) as INavigationInterceptor; if (navigationInterceptor != null) { navigationInterceptor.AddRule("*", NavigationRule.Deny); } loadHTML(); }