This is a migrated thread and some comments may be shown as answers.

UNABLE TO OPEN PDF IN NATIVE BROWSER

1 Answer 52 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Audrey
Top achievements
Rank 1
Audrey asked on 04 Jul 2013, 10:57 AM
Hello,
I'm currently doing an app for iOS and Android. I need to open pdf in native browser for both. I already did it but here, all parts of code I know didn't work. Do you have any idea ?

I used :
Android :
navigator.app.loadUrl(href, { openExternal: true });

Both
window.open(href, '_system');
window.open(href, '_blank');
<a href="someurl.html" rel="external" target="_blank">
<a href="someurl.html" rel="external" target="_system">

No one works : on Android it does nothing, and on iOS it opens the pdf winthin the app, so with must reboot the app to get out of it !

Please help me I'm becomming crazy because this works on another project and not here..

Tried with Cordova 2.4 & 2.7 versions

1 Answer, 1 is accepted

Sort by
0
Audrey
Top achievements
Rank 1
answered on 04 Jul 2013, 11:18 AM
EDIT :
Finally I found a solution :

<a onclick=\"window.open('someurl.html', '_system');\"> works fine ! On both platforms !
Tags
General Discussion
Asked by
Audrey
Top achievements
Rank 1
Answers by
Audrey
Top achievements
Rank 1
Share this question
or