+ Start a Discussion
Scott_VSScott_VS 

Closing In-App Web Browser from Visualforce Page

I am using the SFDC app for iPhone and a created a link to a mobile visualforce page using the method described in this page. Clicking the link brings up the page in an in-app web browser.

 

Is there a way to close this in-app browser from the visualforce page and return the user back to the app screen? It seems like the JavaScript line window.self.close() will not work in this browser. 

AmitSahuAmitSahu

window.self.close() method does not work on most mobile browsers. By the way what mobile you are using for this ?

 

I have tested this with Android 2.3 devices as well and even if I have the browser enabled for the JavaScript, this does not work.

 

Probably you can call an method from the mobile app to close the browser itself.

Big VBig V

Try out  this option:

 

place a link in VF page:

 

 <a href="mobileforce:///close">HTML close</a><br/>

If you want  to sync and close try out the following:

<a href="mobileforce:///sync/close">HTML sync and close</a><br/>
for more info: http://www.salesforce.com/us/developer/docs/pages/Content/pages_mobile_javascript_library.htm