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?

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