Skip to main content
Version: 6.7.0

Browser

There are several use-cases when you need to open a web browser on a touch-enabled device (also known as a tablet). For these cases, you can use a custom web browser we built. Default URL can be opened and even the whitelisting/blacklisting of certain domains is supported.

All methods​

MethodsDescriptionSupported since
open()Open page in integrated browser4.0.0
close()Open page in integrated browser4.4.0

open()​

info

This API is currently available on:

  • Android devices with Android 5+ (Philips, Benq, Sharp, generic Android device)

With some limitation you can use this API also on

  • Samsung Tizen (SSSP 4 and above); where the website is just in fullscreen without an address bar or theme options (headless mode)
  • LG webOS (webOS 3.0 and above); where the website is just in fullscreen without an address bar or theme options (headless mode)
  • Linux (Fedora, Ubuntu), Raspberry Pi, NEC Compute Module; where the website is just in fullscreen without an address bar or theme options (headless mode)
  • BrightSign; where the website is just in fullscreen without an address bar or theme options (headless mode)

Javascript​

Simple opening some page ex. our main company page.

sos.browser.open('https://www.signageos.io'); // Open link in the browser

Method open() also supports properties for browser, all of which are optional.

PropertyTypeDescription
aclDomainsArrayList of domains to be interpreted according to aclMode. Example: signageos.io, www.example.com
aclModeString
  • blacklist – Allow access to all domains except those in aclDomains and their subdomains.
  • whitelist – Allow access only to domains in aclDomains and their subdomains.
readOnlyAddressBarBoolean
  • true – The address bar is read-only.
  • false – The user can navigate away by entering a URL in the address bar.
coordinatesObjectSize and position of the browser window. Defaults to fullscreen. (Android, Linux)
idleTimeoutNumberThe browser will automatically close after a specified period of inactivity (in milliseconds).
themeObjectSpecify custom UI theme. (Android)
headlessModeBooleanHeadless mode hides the entire address bar (default)
canUserCloseBooleanWhether the user can manually close the browser. Default:
Headless: false
With UI: true
clearDataBooleanClear cache after the browser closes. Default:
Headless: false
With UI: true
methodStringCan only be native (which opens a new, fully sandboxed fullscreen window) or iframe (which opens a configurable-sized window). (only Linux)
sos.browser.open('https://www.signageos.io', {
aclDomains: ['google.com', 'yahoo.com'],
aclMode: 'blacklist', // or 'whitelist'
readOnlyAddressBar: true,
coordinates: { // Supported only on Linux and Android
x: 0,
y: 0,
height: 500,
width: 500,
},
// theme: { ... } // supported only on Android
headlessMode: false, // supported only on Android
});

Browser themes usage with Typescript​

You can also use all these methods with signageOS TypeScript.

info

Browser themes are only available on Android devices.

type Color = string;

export type ITheme = {
base?: 'light' | 'dark'; // Default light
shape?: {
cornerSize?: number; // Default 2
};
colors?: {
primary?: Color;
background?: Color;
control?: Color;
};
widgets?: {
editAddress?: {
colors?: {
background?: Color;
text?: Color;
};
};
buttonClose?: {
colors?: {
background?: Color | '@primary';
text?: Color;
icon?: Color;
};
icon?: 'none' | 'exit_to_app' | 'close' | 'cancel';
text?: string;
};
progress?: {
color?: Color | '@primary';
};
};
};

interface IOpenLinkOptions {
aclDomains?: string[];
aclMode?: 'blacklist' | 'whitelist';
readOnlyAddressBar?: boolean;
coordinates?: {
x: number;
y: number;
width: number;
height: number;
};
theme?: ITheme;
headlessMode?: boolean;
clearData?: boolean;
canUserClose?: boolean;
method?: 'native' | 'iframe'
}

open(uri: string, options?: IOpenLinkOptions): void;

close()​

Closing the Browser instance. The whole page is closed. If you call open() again, the page will be loaded from the beginning.

Javascript​

Simple opening some page ex. our main company page.

sos.browser.close(); // Close the browser

Errors​

Although we are doing our best, following errors may occur when opening a link.

CodeTypeMessage
40301AppletBrowserUriErrorProperty argument uri must be a string
50301InternalBrowserOpenLinkErrorUnexpected error occurred when opening $$LINK$$