Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support of opening the inappbrowser with specific coordinates, width & height #668

Open
sagrawal31 opened this issue Apr 13, 2020 · 5 comments · May be fixed by #756
Open

Feature: Support of opening the inappbrowser with specific coordinates, width & height #668

sagrawal31 opened this issue Apr 13, 2020 · 5 comments · May be fixed by #756

Comments

@sagrawal31
Copy link

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

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):

  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.
@sagrawal31
Copy link
Author

sagrawal31 commented Jul 24, 2020

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.

@rajasekarsp
Copy link

This feature is very much needed. Hoping that it will be available soon.

@hamzasharuf hamzasharuf linked a pull request Aug 9, 2020 that will close this issue
5 tasks
@Goncharuk-Nikita
Copy link

Hi, any updates?
We are also looking forward to this feature.

@MichalKiejnich
Copy link

Also looking forward for this one

@Topiya
Copy link

Topiya commented Mar 9, 2022

Any updates? I am finding for the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants