Configuring Browser

BlueFletch Browser configuration can be set using the following methods:

  • Using the Launcher - the BlueFletch Launcher contains a separate section for specifying the BlueFletch browser defaults, as well as override at a per-shortcut basis.

  • Using Intents - this can be used to set specific default configuration values when used in Standalone mode (e.g. without the BlueFletch Launcher).

  • Using Managed Configuration - If deployed from the managed Play Store, you can specify the configuration as a JSON string when the application is deployed to the device.

Configuration via Launcher

To apply different default settings for the Browser, specify the new default values inside the browser section in the Launcher configuration file. By specifying this section, BlueFletch Browser will use this configuration everytime a new browser instance is opened.

"browser" : {
    "showTitle" : "true",
    "allowUrlEdit" : "false",
},
"browserRestrictions" : {
    "blockList" : [
       "facebook.com"
    ],
    "allowList" : []
}

In the above example, everytime a web shortcut is started in the BlueFletch browser, it will show the title in a toolbar, and not allow the user to edit the URL. The browserRestrictions section also applies, and will allow the user to navigate to all sites except facebook.com and its sub-domains.

When configuring shortcuts in Launcher, you can also define overrides which will be applied to that particular shortcut only. Given the configuration below:

"layouts" : [
    "Associates" : [
        {
            "label" : "Office 365",
            "url" : "https://office.com",
            "browser" : "com.bluefletch.ems.browser",
            "browserOverrides" : {
                "showTitle" : "false",
                "allowCameraAccess" : "true"
            }
        },
        {
            "label" : "BlueFletch",
            "url" : "https://www.bluefletch.com",
            "browser" : "com.bluefletch.ems.browser"
        },
        {
            "label" : "Store Fletch",
            "url" : "http://10.1.120.39:8080",
            "browser" : "com.bluefletch.ems.browser",
            "browserOverrides" : {
                "allowInsecureSites" : "true"
            }
        },
    ]
],
"browser" : {
    "showTitle" : "true",
    "allowUrlEdit" : "false",
}

In the above configuration setting, the browser section indicates that all browser instances will show the title, and all the other BlueFletch Browser default values. For the three shortcuts defined:

  • Office365 will render without a toolbar because showTitle for that URL is set to false;

  • BlueFletch websites will render showing the title;

  • Store Fletch website has a necessary override to allow insecure sites set to true to allow it to render (because it is an internal site and does not use https). But because this override is specific to this shortcut, insecure sites will not be allowed from the Office or BlueFletch websites.

Configuration via Intents

Starting with version 2.2.x, Browser can now be configured by sending Intent Actions to set individual configuration parameters that persist on the device. If using the Browser in Standalone mode (e.g. without the BlueFletch Launcher), this allows you to change the default behavior of the BlueFletch Browser.

Action to set a configuration

Action Name: com.bluefletch.ems.browser.ACTION_SET_CONFIG

Extras:

  • Key - the configuration field/key to set all supported/available keys are described in the all configuration section.

  • Value - the new default value for the configuration field/key.

When the BF Browser receives this command, it will save the desired configuration in its local preferences file, and will apply to sites that are opened going forward. This will preference will not be deleted unless the Browser is uninstalled, or if it's application data is cleared.

The following example shows multiple ADB commands to set the title and allow and blocklist values:

adb shell am start -a com.bluefletch.ems.browser.ACTION_SET_CONFIG --es showTitle "true"
adb shell am start -a com.bluefletch.ems.browser.ACTION_SET_CONFIG --es blockList ".*facebook.com,.*twitter.com"  

You can send the command again with a different value to change or replace a configuration field/key.

allowList and blockList configuration fields accept a comma delimited string of the filter rules. If you need to add or remove a filter entry, you must send the entire string again to the blockList or allowList to replace the current settings.

Reset back to Defaults

This action will revert all requested overrides to be reset to the default setting, including allowList and blockList entries.

Action Name: com.bluefletch.ems.browser.RESET_CONFIG

Extras: None

adb shell am start -a com.bluefletch.ems.browser.RESET_CONFIG

Last updated