2

Is there a way to know if window.open failed to open url in new tab in IOS if user has enabled pop up blocker as on in phone settings ?

If the url did not get opened in new tab, I want to use window.location.href and open in same tab.I need that identifier which tells me window.open failed.Please help

Shijil Narayanan
  • 1,011
  • 8
  • 21

1 Answers1

3

This is propablly a duplicate of How do I detect that my pop-up window failed (due to a pop-up blocker)?

Code for what you're trying to do would be this:

var some_url = "some_url"
if(!window.open(some_url)) {
      window.location.href = some_url
}

Does this aswear your question? - I'm sorry, I cannot write comments because of my low reputation.

TDiblik
  • 522
  • 4
  • 18