Skip to main content

Editor for Automations in TheFlex

In TheFlex settings, you can configure automations for any website or web app. Each automation entry can be set as either a script (JavaScript) or as CSS, allowing you to add functions or visual adjustments—without changing the website code itself.

Automation Editor

Hello world

Normal Javascript can be used to adapt websites.

Customize CSS

The appearance of the page can be changed by adjusting the CSS.

Page Ready Event

The page is only fully loaded and rendered after this event.

Customize zoom level

Adjust the zoom level as required depending on the URL.

Open dialog with autofocus

This script opens a customizable dialog with autofocus in which you can scan directly.

Loading...
0 of 3000 characters are used (minified)

Important information for automations

Recommendation

If possible, scripts or CSS should always be maintained directly within the website. However, if this is not possible, automations in TheFlex provide a flexible alternative. Typical use cases include:

  • Visual adjustments of older websites (e.g., ITS-Mobile) that are hard or impossible to change.
  • Visual adjustments for specific devices (like scanners or special terminals).
  • Adding login features (login via NFC chip or QR code) to login pages that cannot be changed (e.g., Microsoft Azure or SAP).
  • Enhancing any 3rd party website or web app without access to its source code.

The deviceready event

If you want to access elements such as input fields or buttons, you must wait for the deviceready event in your automation. Only then is the page fully loaded and all elements are available:

document.addEventListener("deviceready", function () {
// my script
});

Active URL

For each automation, you can define a URL where it is active. The automation is injected only for URLs that start with the configured value—not for an exact match.

Example: The URL https://theflexbrowser.com is opened.

Caution

Always double-check which automations are run, as they have full access to all data on the accessed website as well as all user input.

Transfer automations into the browser

There are three ways to get your code from the editor to the device:

1. Maintenance via MDM

The easiest way is deploying automations via an MDM like SOTI or Intune. Automations can be managed, updated and distributed this way.

Caution

Some MDMs remove certain characters (e.g., \n and \r in SOTI) when pasting. Remove all comments (// …) and always end all statements with a semicolon.

Caution

Intune does not allow newlines in JSON, so your automation code must be condensed to a single line. Double quotes must be escaped with a backslash ( \ ) or replaced by single quotes ('').

2. Import via QR code

If your code is shorter than 3000 characters, you can use Export as QR code. In TheFlex browser settings, use Import automation to scan this QR code into the device.

3. Screenshare

Only recommended for development: If the device is connected to your PC, you can copy and paste code directly into the browser settings.