Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #205 from Daddoon/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Daddoon authored May 4, 2020
2 parents 93c5c31 + ea97c47 commit f73bc35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/BlazorMobile.Web/Components/BlazorMobileComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ internal bool IsWebAssembly()
return _isWebAssembly;
}

private async Task SetRemoteDebugEndpoint()
{
string uri = BlazorMobileService.GetContextBridgeURI();
await Runtime.InvokeVoidAsync("BlazorXamarin.SetDebugRemoteEndpoint", uri);
}

private async Task<bool> JSRuntimeHasElectronFeature()
{
return await Runtime.InvokeAsync<bool>("BlazorXamarin.JSRuntimeHasElectronFeature");
Expand Down Expand Up @@ -193,6 +199,9 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
{
_FirstInit = false;

//Adding remote endpoint for debugging
await SetRemoteDebugEndpoint();

JSRuntime = Runtime;

SetCurrentRuntime(JSRuntime);
Expand Down
6 changes: 6 additions & 0 deletions src/BlazorMobile.Web/wwwroot/blazormobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ window.BlazorXamarin = {
selectedElement.style.display = "none";
}
}
},

SetDebugRemoteEndpoint: function (endpoint) {
if (endpoint !== undefined && endpoint !== null) {
window.contextBridge.connectivity._contextBridgeURI = endpoint;
}
}
};

Expand Down

0 comments on commit f73bc35

Please sign in to comment.