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
- General functionalities
- SAP/ITS/Fiori optimization
- Login automation
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.
ITS example page
Almost all elements in ITS-Mobile can be customized.
ITS login screen for small devices
Optimization of the ITS login screen for devices with small screens.
Scroll functionality for ITS-Mobile
Example of how to add a scrollbar.
SAP RFUI menu optimization
Adaptation of menu buttons in SAP RFUI.
More detailsRead stored login data
Read the username/password which is saved for the current start page.
SAP Fiori login with NFC
An NFC tag is read and automatically logged into SAP Fiori with the stored login data.
ITS-Mobile login with QR code
When a QR code is scanned, the user name/password is parsed and the login is executed in ITS-Mobile.
Microsoft Azure AD/ENTRA with NFC
A multi-stage login process can also be automated.
Important information for automations
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.
- If https is configured as the automation URL, the automation will run.
- If https://theflexbrowser is configured, it will run.
- If https://other.com is configured, it will not run.
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.
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.
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.