How to force the redirection to a new window or tab in a mobile phone browser?

Viewed 828

I am developing a "Vue" application which is basically an order form. In the final step, if you choose to pay directly you are redirected to a secure payment page, opening a new tab in the browser.


      const url = "/api/es/orders/" + this.functionalId
      globalAxios
        .put(url, payload, config)
        .then(res => {
          if (res.data.dev_code) {
            if (this.selectedResume === "payment") {
              const urlPayment = Config.PAYMENT_URL + res.data.dev_code
              window.open(urlPayment, "_blank")
            }
          }
        })
        .catch(error => console.log(error))


The problem is that it does this on all devices except mobile phones. Is there any reason not to do it on mobile? Should I include something specific? What am I doing wrong?

thank you all for your time and help

2 Answers

use location.href = URL That's what I do. Theres also <a href=url>Here</a> but then they'd need to tap/click it...

Related