2

I'm performing a long-running task, and somewhere in the middle, it's possible that this exception can be thrown:

Uncaught DOMException: Blocked a frame with origin "http://localhost:8000" from accessing a cross-origin frame.

The problem is, once this exception is thrown, my long-running, unrelated task is broken up and does not complete successfully. Something about this DOMException messes everything up.

I've tried using window.onerror as suggested here, but all this does is allow me to inspect the error, not prevent it from breaking the application.

Note that I can't use regular try/catch blocks since this iframe is being loaded in HTML.

Any ideas?

Snowman
  • 31,411
  • 46
  • 180
  • 303

1 Answers1

0

Are you catching the exception and handling it gracefully by surrounding it in a try-catch statement?

https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Statements/try...catch

Spencer MacBeth
  • 147
  • 1
  • 4