Reputation: 611
I am using inappbrowser plugin on my cordova 3.4.0 iOS project. I am trying to show toolbar so that user can back to app. But no toolbar is showing.
My code is
window.open("http://www.youtube.com/embed/OFFXHbjVZ7A?html5=1",'_blank','location=no,closebuttoncaption=Done,toolbar=yes,toolbarposition=top');
i tried with but no luck
var ref = window.open('http://www.youtube.com/embed/OFFXHbjVZ7A?html5=1', '_blank', 'location=yes');
ref.addEventListener('loadstart', function() { alert(event.url); });
log is
2014-03-31 16:04:35.549 Survey[3202:60b] Multi-tasking -> Device: YES, App: YES
2014-03-31 16:04:35.617 Survey[3202:60b] Unlimited access to network resources
2014-03-31 16:04:37.562 Survey[3202:60b] Resetting plugins due to page load.
2014-03-31 16:04:38.557 Survey[3202:60b] Finished load of: file:///var/mobile/Applications/CBFA4CF5-ABFD-41BD-8832-064022B1699D/Survey.app/www/index.html
2014-03-31 16:04:41.698 Survey[3202:60b] Resetting plugins due to page load.
2014-03-31 16:04:53.948 Survey[3202:60b] Finished load of: http://www.youtube.com/embed/OFFXHbjVZ7A?html5=1
It is showing video but no back button
Basically i need to back to app.
Any suggestion is highly appreciated.
Thanks in advance
Upvotes: 4
Views: 5190
Reputation: 596
Although this question isn't new, the answer has changed with the 1.0.0 (Apr 15, 2015) release of InAppBrowser: use cordova.InAppBrowser.open rather than window.open.
I'm not sure the full scope, but at the very least it's relevant to Cordova 5.0.0 building for iOS 8.
Upvotes: 0
Reputation:
If you are using this on your system - check for cordova_plugins.js. See if it is being populated with the clobber data(its a property in the field, dont have to get into details of it). If not then go to the terminal and in your project folder run "cordova prepare". If you dont have cordova cli installed use - "phonegap build ios". It should populate cordova_plugin.js with your inappbrowser clobbber data.
You would find cordova_plugin.js in platform/ios/asset/www/
Upvotes: 1
Reputation:
Are you sure your inappbrowser plugin is being loaded? If you are getting the same result on _system, then I guess your inappbrowser is not loading.Most of the time , developers face this problem. What you could do is use this example instead of your line of code -
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstart', function() { alert(event.url); });
If the alert fires up , we have a bigger fish to fry else we have to find why your plugin is not being loaded. You are doing this locally or using phonegap build?
Upvotes: 0