-2

How can a link be opened in a native phone browser when clicked in hybrid apps ? I built hybrid apps with Sencha Touch.

Like <a href="www.example.com"> view me in a browser </a>

Aflext
  • 309
  • 4
  • 15
  • 4
    No. At least not with anything portable. –  Mar 05 '13 at 06:59
  • Do you really mean another *browser* ("Here I am in Firefox and … why is Internet Explorer loading?!") or do you mean *window*? – Quentin Mar 05 '13 at 07:03
  • @Quentin, I had this question, assuming he is interested in new window observing `window.createBrowser()` I have answered accordingly.. – Rookie Programmer Aravind Mar 05 '13 at 07:05
  • if it's another browser then ... it's a bad question.. – Rookie Programmer Aravind Mar 05 '13 at 07:05
  • another browser process. – Aflext Mar 05 '13 at 07:06
  • 1
    @alext, why do you need to that btw? or is it just a curious q?? – Rookie Programmer Aravind Mar 05 '13 at 07:08
  • Do you mean another browser process for the same browser (which isn't something you tend to need these days as browsers are heading towards independent processes for different tabs anyway) or a different browser completely (in which case — why? And what do you think will happen if the browser you want isn't installed?) – Quentin Mar 05 '13 at 07:11
  • "In an iOS app" is a completely different context to the implied "on the open web" that you started with… but *And for new links in the html code in the coat they can't go back* doesn't make sense. Every iOS app I've seen which embeds a browser window (Facebook, Twitter, Instapaper, etc) adds a back button to the chrome. There is no obvious reason you can't do that too. – Quentin Mar 05 '13 at 07:17
  • @Quentin It is good for our project to make links go out of the app coat whatever the browser is.We haven't got a back button now. – Aflext Mar 05 '13 at 07:26

1 Answers1

1

Is there a way to invoke another browser?

Yes, there is. You can do this using window.open() function. But, you may read following description as why not to use it.

Please, don't force opening a link in a new window.

Reasons against it:

  • It infringes the rule of the least astonishment.
  • The back-button don't work and the user not possibly knows why.
  • What happen in tabbed browsers? New tab or new window? And whichever happens, is it what you wants, if you mix tabs and windows?

The reason I always hear in favor of opening a new window is that the user will not leave the site. But be sure, I will never come back to a site that annoys me. And if the site takes away control from me, that is a big annoyance.

A way may be, that you give two links, one is normal, the other opens it in a new window. Add the second with a little symbol after the normal link. This way users of your site stay in control of which link they want to click on.

EDIT:

OP's question is to open a new browser and not a new window of the browser. So I am keeping this answer as it explains why we shouldn,t forcing to create new windows.

Bhushan Firake
  • 9,338
  • 5
  • 44
  • 79