You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/04/13 13:43:27 UTC

[GitHub] [cordova-plugin-inappbrowser] sagrawal31 opened a new issue #668: Feature: Support of opening the inappbrowser with specific coordinates, width & height

sagrawal31 opened a new issue #668: Feature: Support of opening the inappbrowser with specific coordinates, width & height
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/668
 
 
   # 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
   
   1. 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.
   
   2. 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.
   
   ![image](https://user-images.githubusercontent.com/1804514/79124177-62e7c680-7db9-11ea-8ce4-9a31d9f6e7cf.png)
   
   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:
   
   ```javascript
   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](https://github.com/wizpanda/cordova-plugin-overappbrowser) & 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):
   
   1. Does not use `WkWebView` which is now required for new apps on AppStore.
   2. 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.
   3. The author does not maintain it so bug fixes, improvements are hard to get pushed.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org