cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@chromium.org>
Subject Re: Changing config.xml settings at runtime
Date Mon, 11 Feb 2013 19:07:07 GMT
Hmm, yeah, definitely doesn't make sense for the whitelist. Not really for
BackupWebStorage either... If we're not saving across restarts, then
BackupWebStorage won't use the updated settings anyways.

Looking through the documentation, I think that most settings wouldn't have
a reason to change... Only ones are maybe:
UIWebViewBounce
EnableViewportScale

And also the KeyboardShrinksView one I wanted to add.

Perhaps another avenue here is to put this in an "App" plugin. Android
currently has an navigator.app with methods like "clearCache",
"overrideBackButton".

We could explicitly have methods such as:
navigator.app.setKeyboardShrinksView(true),
navigator.app.setUIWebViewBounce(false)

I'm not really sure if this would make more sense, or if it even matter
which approach we go with :P.




On Mon, Feb 11, 2013 at 11:59 AM, Shazron <shazron@gmail.com> wrote:

> The only case (as Brian mentions) is not allowing the whitelist to be set
> at runtime.
> Also - does the app have to "reset" if a setting that was read at runtime
> was changed? ie we probably need a "configchanged" event/notification or
> something. For example, BackupWebStorage in iOS, etc.
>
>
> On Sun, Feb 10, 2013 at 11:01 AM, Andrew Grieve <agrieve@chromium.org
> >wrote:
>
> > First - I'd like to add yet another setting for iOS:
> >
> > KeyboardShrinksView (boolean).
> >
> > It applies to apps that position their elements relative to the bottom of
> > the webview. When the keyboard comes up, I'd like to shrink the webview
> > rather than shrink the viewport and have the page scrollable. This is the
> > default behaviour on Android, and makes a lot of sense when building apps
> > as opposed to webpages.
> >
> >
> > But... Reason for this email, is I think it'd be useful to have a
> > x-platform API for changing the settings within config.xml at runtime.
> > Something like:
> >
> > cordova.setConfigValue(key, value)
> >
> > An example of the keyboard case:
> > app.onPageChange = function(pageName) {
> >   cordova.setConfigValue('KeyboardShrinksView', pageName != 'help');
> > };
> >
> > And I suppose adding a getter makes sense:
> > cordova.getConfigValues(successCallback)
> >
> > I'm thinking that setting these at runtime will *not* persist across app
> > restarts to avoid the issue of what should happen when devs push updates
> to
> > their apps that change settings around.
> >
> > If everyone's okay with this, I'll file a bug & sub-bugs per-platform.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message