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

CB-8467 provide hide method to hide browser window #101

Conversation

herrevilkitten
Copy link
Contributor

Added support for hiding the web view container. This maintains the browser
session without closing it. The browser window can be repeatedly hidden and
shown.

** This has only been tested on android and ios **

amazon/android:
An additional hide action was added to InAppBrowser#execute. It is
identical to show, except that it calls dialog.hide() instead.

blackberry10:
no changes

firefoxos:
Added a hide method that is identical to show, indicating it is not
supported.

ios:
Added a hide method that is identical to show, except that it uses
dismissViewControllerAnimated. It checks the value of
_previousStatusBarStyle. If it is -1, the method returns with no
action performed. If it is not, it is set to -1.

ubuntu:
Added a hide method that sets CordovaWrapper.global.inappbrowser.visible to
false.

windows:
Added a hide method that sets browserWrap.style.display to none.

wp:
Added a hide method that is identical to show, except that it sets
browser.Visibility to Visibility.Collapsed and sets AppBar.IsVisible to
false.

@schoettler
Copy link

+1

@zalun
Copy link
Contributor

zalun commented Sep 9, 2015

FFOS +1

@sgrebnov
Copy link
Member

sgrebnov commented Feb 8, 2016

lgtm

@sfrank87
Copy link

Hi,
I am interested in this functionality, too. It’s a pity, it never found its way to the upstream repository. :/
Could you please solve the merge conflicts? That would be great. :D
Thanks a lot!

Frank

Copy link

@PaulBaugher PaulBaugher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this in?

@herrevilkitten
Copy link
Contributor Author

Sure I can fix the conflicts. It's ... been a while

@herrevilkitten herrevilkitten force-pushed the CB-8467_provide_hide_method_to_hide_browser_window branch 2 times, most recently from 21b131a to c70882f Compare October 18, 2016 14:39
Added support for hiding the web view container.  This maintains the browser
session without closing it.  The browser window can be repeatedly hidden and
shown.

** This has only been tested on android and ios **

amazon/android:
An additional `hide` action was added to `InAppBrowser#execute`.  It is
identical to `show`, except that it calls `dialog.hide()` instead.

blackberry10:
no changes

firefoxos:
Added a `hide` method that is identical to `show`, indicating it is not
supported.

ios:
Added a `hide` method that is identical to `show`, except that it uses
`dismissViewControllerAnimated`.  It checks the value of
`_previousStatusBarStyle`.  If it is `-1`, the method returns with no
action performed.  If it is not, it is set to `-1.`

ubuntu:
Added a `hide` method that sets `CordovaWrapper.global.inappbrowser.visible` to
`false`.

windows:
Added a `hide` method that sets `browserWrap.style.display` to `none`.

wp:
Added a `hide` method that is identical to `show`, except that it sets
`browser.Visibility` to `Visibility.Collapsed` and sets `AppBar.IsVisible` to
`false`.
@herrevilkitten herrevilkitten force-pushed the CB-8467_provide_hide_method_to_hide_browser_window branch from c70882f to df8bcaf Compare October 18, 2016 14:41
@herrevilkitten
Copy link
Contributor Author

@sfrank87 @digitalskyline conflicts de-conflicts, checks passed

@cordova-qa
Copy link

Cordova CI Build has one or more failures.

Commit - Link
Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Link Link Link

@jcesarmobile
Copy link
Member

let there be tests

@cordova-qa
Copy link

Cordova CI Build has one or more failures.

Commit - Link
Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Link Link Link

@sfrank87
Copy link

Hi.
Thank you very much for your effort. :)

I found an misstake in CDVInAppBrowser.m. The hide method was implemented twice, in line 246 and in line 270. ^^"

However, I wonder what's wrong with the android build. After all, the hide implementation is an exact copy of show, except for two words. (i diffed both sections, seems no misstakes). And the Jenkins log seems a bit strange, too. For me, it’s a bit conspicuous that it says “no workspace”. O.o

regards
Frank

@sfrank87
Copy link

Btw, I have written a little test case for the hide method, that can be found here.

@herrevilkitten just copy&paste the tests.js into the tests/ folder. This adds a litte automatic test, checking for the existence of the JS hide method and a manual test that opens the IAB, than hides it after 2 seconds.

regards
Frank

@jcesarmobile
Copy link
Member

@sfrank87 can you send a PR to @herrevilkitten repo against CB-8467_provide_hide_method_to_hide_browser_window branch removing the duplicate method and adding the test?

@sfrank87
Copy link

@jcesarmobile

done.

regards
Frank

@PaulBaugher
Copy link

I added this to my project much appreciated!

…de_browser_window

removed duplicate hide method in ios source and add jasmine test cases
@herrevilkitten
Copy link
Contributor Author

Thanks you @sfrank87 for the help with this :)
The duplicate methods are probably from some wacky merge conflict resolution I had going on.

@jcesarmobile
Copy link
Member

let there be tests

@cordova-qa
Copy link

Cordova CI Build has completed successfully.

Commit - Link
Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Link Link Link

@asfgit asfgit closed this in e853399 Oct 19, 2016
@jcesarmobile
Copy link
Member

merged, thank you everyone and sorry that it took so long

@bgallz
Copy link

bgallz commented Jun 27, 2017

Thank you for providing this update!

I have one question however. I am using Ionic v2.1.4 with iOS v4.0.1 (not sure that's relevant in this case) and I am seeing that the view controller used in the hide method here does not have any effect.

This line:
[self.viewController dismissViewControllerAnimated:YES completion:nil];

Does not appear to do anything. However, when I make the dismiss call like so:
[self.inAppBrowserViewController dismissViewControllerAnimated:YES completion:nil];

The InAppBrowser is hidden as expected. Can anyone else confirm this?

Thanks again!

@jcesarmobile
Copy link
Member

@bgallz there is a bug (already reported) about hide not working because of other changes.

@bnova-stefan
Copy link

Hi @jcesarmobile
Could you tell me more about the bug? I have to hide the browser to scan something with the camera and fill in the scanned value in a form field.
Is there any workaround to hide the browser window?

Thank you very much
Stefan

@herrevilkitten
Copy link
Contributor Author

saschal-j5int pushed a commit to saschal-j5int/cordova-plugin-inappbrowser that referenced this pull request Oct 23, 2023
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 this pull request may close these issues.

None yet