cordova-plugin-inappbrowser
cordova-plugin-inappbrowser copied to clipboard
Feature: Support of opening the inappbrowser with specific coordinates, width & height
Feature Request
(I was under the impression that an issue is there for this feature so I tried to search but couldn't find any)
Motivation Behind Feature
-
The motivation behind this feature is that Cordova developers can open their external URLs in the app in a way that it doesn't look like actually an in-app browser which is opened on top of my current app view. Instead, if that external URL is themed like the app and is responsive, the end-user can fill that no in-app browser is opened and they get a feeling that the external content is being watched inside the app itself.
-
Another motivation is to make the plugin (or the in-app view) positionable so that the developers don't have to bake another Cordova plugin into their apps to place their in-app view within a given coordinates/width/height.
Feature Description
General Description
It's simple (in terms of explanation 😄). As of now opening the in-app browser open the in-app view covering the entire screen but this feature will help developers to open the web view within a set coordinates (the x & y-axis) with option width & height so that the external URLs can be opened along with the views of the Cordova app.
Possible Example after this feature is implemented
For example, I want to open the "Terms & Condition URL" of my website in the app where it can take the entire screen but on top of it, it should have a custom toolbar which is basically the toolbar from my main Cordova app/view.
In the above screenshot, the red highlighted area is the view from my actual Cordova app.
While the green highlighted area is basically the result of this feature i.e. the in-app browser opened with a specific coordinate so that it doesn't overlay my toolbar on the top. Now, the user does not fill that they are seeing a separate view, instead this view (the terms) is the part of that screen.
Possible code change & the usage
New options would be x
, y
, width
, height
. So the developer can write something like this:
cordova.InAppBrowser.open('http://myapp.com/terms', '_blank', 'location=yes,x=0,y=200,width=437,height=650');
So this will open the in-app browser from the 0,200px position from the top.
Any drawbacks/breaking change
No, there won't be any drawbacks or breaking change as those 4 variables will have there default values to open the in-app browser covering the entire screen.
Alternatives or Workarounds
There is one alternative plugin available https://github.com/etabard/Cordova-OverAppBrowser (which we forked & updated) which is kind of copy of this plugin and the author tweaked the code to make it positionable at given coordinates.
And we are using that plugin. The problems with the plugin are (in the priority of highest priority):
- Does not use
WkWebView
which is now required for new apps on AppStore. - This
Cordova-OverAppBrowser
plugin is basically ==cordova-plugin-inappbrowser
-lots of bug fixes
-lots of improvements
+coordinates feature
that means in-app browser functionality is available via two plugins in one app which is redundant. - The author does not maintain it so bug fixes, improvements are hard to get pushed.
Any update here? Since this plugin is already using WkWebView
most of the developers has started to worry about this feature as the existing plugin is not being maintained and using UIWebView
.
This feature is very much needed. Hoping that it will be available soon.
Hi, any updates? We are also looking forward to this feature.
Also looking forward for this one
Any updates? I am finding for the same thing.