@inject IJSRuntime JS @inject State State @inject ApiService api @if(Html != null) { } @code { [Parameter] public string? Url { get; set; } [Parameter] public string? id { get; set; } [Parameter] public string? SrcString { get; set; } public MarkupString? Html { get; set; } protected override async Task OnAfterRenderAsync(bool firstRender) { if(firstRender){ await Reload(); } } public async Task Reload() { if (Url != null){ Html = await api.GetHtml(Url); SrcString = Html?.ToString(); } if(SrcString != null) { SrcString = SrcString?.Replace("", ""); SrcString = SrcString?.Replace("", ""); Html = (MarkupString)(SrcString ?? string.Empty); } await InvokeAsync(StateHasChanged); await IframeResize(); } public async Task IframeResize() { await JS.InvokeVoidAsync("iframeResize", new { license = "GPLv3" }); } }