Blazor.Printing
Blazor.Printing copied to clipboard
Getting cross-origin error in Edge but it works in Google Chrome
Firstly I want to thank you for your efforts and making this library. It is greatly apreciated.
I am getting this error in microsoft edge version 104.0.1293.63 but not google chrome. I have pasted the errors from the browser console below.
Uncaught DOMException: Blocked a frame with origin "http://localhost:51490" from accessing a cross-origin frame.
at u (http://localhost:51490/_content/Append.Blazor.Printing/scripts.js:1:4641)
at n.onload (http://localhost:51490/_content/Append.Blazor.Printing/scripts.js:1:5701)
onError @ scripts.js:1
u @ scripts.js:1
n.onload @ scripts.js:1
load (async)
send @ scripts.js:1
b @ scripts.js:1
(anonymous) @ scripts.js:1
load (async)
m @ scripts.js:1
x @ scripts.js:1
print @ scripts.js:3
(anonymous) @ blazor.webassembly.js:1
beginInvokeJSFromDotNet @ blazor.webassembly.js:1
St @ blazor.webassembly.js:1
_mono_wasm_invoke_js_blazor @ dotnet.6.0.8.5qvbcwublj.js:1
$func219 @ 00971db2:0x1a48f
$func167 @ 00971db2:0xce5d
$func166 @ 00971db2:0xbd70
$func2812 @ 00971db2:0xabf00
$func1616 @ 00971db2:0x6fcc1
$func1620 @ 00971db2:0x7032e
$func3214 @ 00971db2:0xc4e92
$mono_background_exec @ 00971db2:0x9434b
Module._mono_background_exec @ dotnet.6.0.8.5qvbcwublj.js:1
pump_message @ dotnet.6.0.8.5qvbcwublj.js:1
setTimeout (async)
_schedule_background_exec @ dotnet.6.0.8.5qvbcwublj.js:1
$func2389 @ 00971db2:0x942fc
$func3213 @ 00971db2:0xc4e22
$func219 @ 00971db2:0x1a4f7
$func167 @ 00971db2:0xce5d
$func166 @ 00971db2:0xbd70
$func2812 @ 00971db2:0xabf00
$func1616 @ 00971db2:0x6fcc1
$func1614 @ 00971db2:0x6fc33
$func967 @ 00971db2:0x50684
$func219 @ 00971db2:0x1a448
$func167 @ 00971db2:0xce5d
$func166 @ 00971db2:0xbd70
$func2812 @ 00971db2:0xabf00
$func1616 @ 00971db2:0x6fcc1
$func1614 @ 00971db2:0x6fc33
$func967 @ 00971db2:0x50684
$func219 @ 00971db2:0x1a448
$func167 @ 00971db2:0xce5d
$func166 @ 00971db2:0xbd70
$func2812 @ 00971db2:0xabf00
$func1616 @ 00971db2:0x6fcc1
$func1620 @ 00971db2:0x7032e
$mono_wasm_invoke_method @ 00971db2:0x969c
Module._mono_wasm_invoke_method @ dotnet.6.0.8.5qvbcwublj.js:1
managed__Microsoft_AspNetCore_Components_WebAssembly__Microsoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet @ managed__Microsoft_AspNetCore_Components_WebAssembly__Microsoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet:19
beginInvokeDotNetFromJS @ blazor.webassembly.js:1
b @ blazor.webassembly.js:1
invokeMethodAsync @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
invokeWhenHeapUnlocked @ blazor.webassembly.js:1
A @ blazor.webassembly.js:1
N @ blazor.webassembly.js:1
dispatchGlobalEventToAllElements @ blazor.webassembly.js:1
onGlobalEvent @ blazor.webassembly.js:1
Show 28 more frames
I have the same problem too on both google chrome and Edge with blazor web webassembly
Hi @kgday! I noticed you're using HTTP instead of HTTPS, can you try to reproduce the issue then?
I shall. However Http works in Chrome. I am not using https since this is for a clients internal busines application that is not exposed to the outside internet.
Do you have steps to reproduce, such as a security setting I can turn on to see the error? This error is probably due to the iframe, but I can't get it to happen.
In chrome where it works everything is stock standard. In ms Edge where it doesn't, also is standard settings. I just did a reset of edge browser settings to set them to the defaults. It still doesn't work. I am using windows 11 and Edge Version 110.0.1587.41 (Official build) (64-bit).
In both published release mode app and the debug version I get the below:
crbug/1173575, non-JS module files deprecated
In the server log the controller action is being executed successfull: Request finished HTTP/1.1 GET http://localhost:51400/api/label/item/6556 - - - 200 1075274 application/pdf 151.3329ms
I am not sure what else I can get you.
Looking at the crbug/1173575
a bit like https://answers.microsoft.com/en-us/microsoftedge/forum/all/microsoft-edge-is-blocking-javascript-from-running/8bff0a10-f7d3-46c0-b948-3cd038f04167
Turning off tracking prevention didn't do anything, or down-grading the privacy settings.