SamsungInternet / support

For general Samsung Internet support. You can use the Issues register here as a way to ask support questions.
MIT License
17 stars 0 forks source link

Using JS to Click an <a> Tag Doesn't Work #75

Closed CatGuardian closed 4 years ago

CatGuardian commented 5 years ago

Hello.

When you try to programatically click an <a> tag, the samsung browser doesn't actually go to the page specified.

Consider this snippet:

    const hiddenAnchorTag = window.document.createElement('a');

    hiddenAnchorTag.hidden = true;
    hiddenAnchorTag.target = '_blank';
    hiddenAnchorTag.href = 'googlechrome://navigate?url=www.test.com';

    this.$window.document.body.appendChild(hiddenAnchorTag);

    hiddenAnchorTag.click();

When this is executed, it should open up the Google Chrome app. But here is what actually happens:

  1. If you haven't allowed pop-ups yet for the website that ran this code:

    • Then a notification appears saying that a pop-up was blocked with a button that says 'allow pop-ups'. When you click 'allow pop-ups', then it opens up the google chrome app like expected.
  2. if you already allowed pop-ups for the website that ran this code:

    • Then a new tab is opened up with the 'googlechrome://navigate?url=www.test.com' appearing in the navigation bar but Google Chrome did not open up.

Furthermore if I have this:

<a href='googlechrome://navigate?url=www.test.com' target='_blank'></a>

And I manually click on that then it will always open up Google Chrome in both cases of 1 and 2.

There is a bug here.

PicchiKevin commented 4 years ago

Hi, Thank you for opening this issue. We are currently migrating our support channel to the Samsung Developer Forum. If you are still experiencing this issue I'd highly recommend re-opening it here please https://forum.developer.samsung.com/c/samsung-internet/

Thanks again, -Kevin