0

So I've been "developing" web apps for Ubuntu mobile devices using the Web App Generator and all seems to be going well... But some - not all - of my web apps move over to the browser when a link is clicked.

Is it possible to prevent web apps from opening their content in the browser, and force them to stay within the web app itself?

Am I missing something - is there some way I can do this within the Web App Generator? Or perhaps by manually editing one of the files inside the web app setup (".click") file?

Gregory Opera
  • 2,531
  • 7
  • 30
  • 58

1 Answers1

0

I had a similar issue a while ago with a Web App being pinned to the Home screen of an iOS device.

The issue was related to the way the App treated links. i.e. if there is a link we need to open it in a webs browser

I'm unsure if the code will work in your situation as I have not used the Web App Generator to test but here it is.

var a=document.getElementsByTagName("a");
for(var i=0;i<a.length;i++)
{
    a[i].onclick=function()
    {
        window.location=this.getAttribute("href");
        return false
    }
}

StackOverflow link for reference:

https://stackoverflow.com/questions/2898740/iphone-safari-web-app-opens-links-in-new-window

  • I extracted the ".click" package and had a look through the files contained therein using gedit... But I couldn't find the code you talk about, or anything that looked similar. – Gregory Opera Apr 04 '16 at 08:47
  • From what I can tell you are trying to create an app by wrapping a website in a browser. If so you need to add this code to the website as Javascript – Michael Smith Apr 04 '16 at 08:55