+1
Beantwortet
Is there an easy way to launch all links from a web tag in Safari?
I think I've seen this in some demo or sample app, but I'm not finding it in the documentation. Can I display one web page or HTML file in a web view, but tell it to open any link in Safari? Basically, I'm building a single-serve web page that has a flexible list of links, but I want all the links to open sites in Safari and bounce users out of the app. Is this possible?
Customer support service by UserEcho
<assign property="var:website" value="[object:WEB.navigation]" />
<load url="safari-[var:website]" target="WEB" />
...
<main>
<web name="webview" alias="WEB" url="http://www.test.com/staticpage.html" style="webstyle" onnavigation="sendlinktosafari"></web>
<web name="hidden" alias="HIDDEN" url="" style="hidden"></web>
</main>
...
<actions>
<action name="sendlinkstosafari">
<sync>
<assign property="var:safarilink" value="[object:WEB.url]" />
<load url="safari-[var:safarilink]" target="HIDDEN" />
</sync>
</action>
</action>
...
When I assign a variable, how do I get the url from the link that's tapped? (In my example, I'm assuming it's just the url attribute ([object:WEB.url]).
Also, what are the cross-platform implications here? Will the same thing bounce it out to Android's browser or Chrome or whatever comes standard on those things?
<load url="http://rarewire.com" external="yes" target="WEB" />