inappbrowser

Enable download in inAppBrowser - Phonegap / Cordova

给你一囗甜甜゛ 提交于 2019-12-02 05:28:00
问题 I'm using cordova 3.5-0.26 & inAppBrowser 0.5.0 Now I'm loading an external page in inAppBrowser. There is a download button. When I press the download it doesn't do anything. I thing download is off in inAppBrowser. So as in the cordova view. Then I tried to active the download manager using following code (for Android) appView.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength)

Opening two instances of InAppBrowser (_system and _blank) prevents events from triggering

浪子不回头ぞ 提交于 2019-12-02 00:29:28
问题 We’re currently developing an app with cordova and the InAppBrowser plugin. We're trying to spawn two different IAB instances at the same time. One with the _system browser and another with the _blank option. The problem we have is that once we open the instance of _system browser, it seems we lose the reference to the previous browser. For this reason, the close event never triggers on the _blank IAB after the _system browser is closed. This is how the actual code looks like. // Opening iab

Enable download in inAppBrowser - Phonegap / Cordova

☆樱花仙子☆ 提交于 2019-12-02 00:14:31
I'm using cordova 3.5-0.26 & inAppBrowser 0.5.0 Now I'm loading an external page in inAppBrowser. There is a download button. When I press the download it doesn't do anything. I thing download is off in inAppBrowser. So as in the cordova view. Then I tried to active the download manager using following code (for Android) appView.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); } }); This

Opening two instances of InAppBrowser (_system and _blank) prevents events from triggering

久未见 提交于 2019-12-01 23:49:48
We’re currently developing an app with cordova and the InAppBrowser plugin. We're trying to spawn two different IAB instances at the same time. One with the _system browser and another with the _blank option. The problem we have is that once we open the instance of _system browser, it seems we lose the reference to the previous browser. For this reason, the close event never triggers on the _blank IAB after the _system browser is closed. This is how the actual code looks like. // Opening iab main window var ref = window.open(global.chat_mediador, '_blank','location=no,toolbar=yes'); var

How to close InAppBrowser itself in Phonegap Application?

情到浓时终转凉″ 提交于 2019-12-01 16:11:16
I am developing Phonegap application and currently i am using InAppBrowser to display external pages. On some of the external pages I place a close button and i want to close the InAppBrowser itself. because InAppBrowser displays these pages that is why the reference of it is not accessed on itself to close it and Please do not suggest me to use ChildBrowser Plugin. window.close(); //Not Worked for me or iabRef.close(); //Also not Worked for me because iabRef is not accessible on InAppBrowser. It is created on Parent Window Some of the Android device and iOS device display a Done Button to

How to close InAppBrowser itself in Phonegap Application?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 15:08:13
问题 I am developing Phonegap application and currently i am using InAppBrowser to display external pages. On some of the external pages I place a close button and i want to close the InAppBrowser itself. because InAppBrowser displays these pages that is why the reference of it is not accessed on itself to close it and Please do not suggest me to use ChildBrowser Plugin. window.close(); //Not Worked for me or iabRef.close(); //Also not Worked for me because iabRef is not accessible on InAppBrowser

InAppBrowser passing a callback function

早过忘川 提交于 2019-12-01 10:57:03
问题 I have a InAppBrowser working fine in my app $scope.openInAppBrowser = function (url) { var ref = window.open(encodeURI(url), '_blank', 'location=yes'); ref.addEventListener('loadstop', function (event) { if (event.url.match("close")) { $scope.refreshGamePage = 1; // this variable is under watch in a directive ref.close(); } }); } here is the directive written to refresh the page module.directive('reloadPage', ['$http', function ($http) { return { restrict: 'A', link: function ($scope,

Cordova / Ionic - Download file from InAppBrowser

心已入冬 提交于 2019-12-01 05:59:43
The scenario goes like this: I open a website in InAppBrowser, after the user ends with the work over there, the site generates a .pdf for the user to download, the problem is that the pdf does not download, it opens it in the browser. Is there a way to make it download from the InAppBrowser? I'm currently working on an iOS app, so the solution would be better for iOS. Thanks in advance. Ariel Following @jcesarmobile advices this is what I came up with: First I had to install the cordova-plugin-file-transfer Open URL var url = "http://mi-fancy-url.com"; var windowref = window.open(url, '_blank

Cordova / Ionic - Download file from InAppBrowser

佐手、 提交于 2019-12-01 04:11:57
问题 The scenario goes like this: I open a website in InAppBrowser, after the user ends with the work over there, the site generates a .pdf for the user to download, the problem is that the pdf does not download, it opens it in the browser. Is there a way to make it download from the InAppBrowser? I'm currently working on an iOS app, so the solution would be better for iOS. Thanks in advance. 回答1: Following @jcesarmobile advices this is what I came up with: First I had to install the cordova

impossible to close inAppBrowser window

…衆ロ難τιáo~ 提交于 2019-12-01 00:47:13
I can open my window, and do a lot of things inside of it, for example login via Linkedin or Facebook. But I cannot close it to return to my app. 1/ I tried to catch events to track the url and close the window when the url contains a particular keyword. But the event is never fired. I never have any alert. var ref = window.open(url, '_blank', 'location=no'); ref.addEventListener('loadstart', function(event) { alert(event.url); }); ref.addEventListener('loadstop', function(event) { alert(event.url); }); 2/ So I tried to find a way to check ref.location.url from the first window every n seconds