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

Expose Webview to allow custom config/handlers #39

Open
airandfingers opened this issue Apr 22, 2019 · 3 comments
Open

Expose Webview to allow custom config/handlers #39

airandfingers opened this issue Apr 22, 2019 · 3 comments

Comments

@airandfingers
Copy link

Hi, I see that you closed #33 citing that "Providing a custom UI goes against the Oauth2 spec", but there are other reasons that exposing the Webview would be very useful:

  • Set Android WebView settings:
    • webview.android.setWebChromeClient(new android.webkit.WebChromeClient());
    • android.getSettings().setBuiltInZoomControls(false);
    • android.getSettings().setUserAgentString('CUSTOM_UA_STRING');
  • Set custom loadStartedEvent and loadFinishedEvent handlers

Are there other ways to accomplish the tasks above without accessing the Webview?

@airandfingers
Copy link
Author

Here's how I messily satisfied this need in the original nativescript-oauth plugin: alexziskind1/nativescript-oauth#58

@eliottrobson
Copy link

eliottrobson commented Jan 18, 2020

The main one for me is to be able to set the navigation button back text to the same title as the previous page.

@alexziskind1 Is this something you would be happy to PR if I made options configurable?

@maplepam
Copy link

maplepam commented Jun 10, 2020

May we also allow config to add an activity indicator while the Webview is still loading the content and hide on pageLoadFinished?

var myloadingObject = { isLoading: true };
var indicator = new loading_indicator_1.ActivityIndicator();
indicator.bind({
   sourceProperty: "isLoading",
   targetProperty: "busy"
}, myloadingObject);
    
var stack = new stack_layout_1.StackLayout();
var grid = new grid_layout_1.GridLayout();
grid.addChild(webView)
stack.addChild(indicator);
stack.addChild(grid);

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

No branches or pull requests

3 participants