# 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](/bluefletch-enterprise/product-guides/browser/technical-guide/all-configuration.md) 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:

<pre><code><strong>adb shell am start -a com.bluefletch.ems.browser.ACTION_SET_CONFIG --es showTitle "true"
</strong><strong>adb shell am start -a com.bluefletch.ems.browser.ACTION_SET_CONFIG --es blockList ".*facebook.com,.*twitter.com"  
</strong></code></pre>

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

{% hint style="info" %}
`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.
{% endhint %}

### 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

<pre><code><strong>adb shell am start -a com.bluefletch.ems.browser.RESET_CONFIG
</strong></code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/browser/technical-guide/configuring-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
