4

using angular with ngrx I have to open, on the same page, a URL outside my application after a backend response. This works fine in Chrome but in Firefox I'm having a lot of request blocked with NS_BINDING_ABORTED. I am redirecting to another angular application which by the way never get reached. Confirmed via console.log on very first instructions.

enter image description here

In the application, when a buttons is clicked a specific actions is dispacthed. In the subscribe of the effect linked to the response the window.location is called.

this.subsink.add(
      this.actions$
        .pipe(
          ofType(toreActions.REQUEST),
          filter((resp) => *somefilter*)
        )
        .subscribe((url) =>
            window.open(url, '_self');
        )
    );

Tried window.location.open, window.location.href as well, but none of them work. I've tried other solutions such as setInterval inside the subscribe but again it does not work.

3
  • please share a minimal code stackblitz with the issue reproduced for debugging! Commented Feb 8, 2024 at 13:43
  • why not just location.href=url, or location.assign(url)? window.open has some checks regarding user-initiated. Open will also create a new handle methinks... Commented Feb 8, 2024 at 22:00
  • None of the proposed solution works... Commented Feb 13, 2024 at 8:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.