Supported frameworks
- Electron, with first-class support through the
rev-utilshelper (see below) - Tauri
- NW.js, CEF, Wails, Neutralino and other Chromium- or webview-based frameworks
- Native apps with an embedded webview: WebView2 (Windows), WKWebView (macOS) and WebKitGTK (Linux)
Desktop requirements
- Open ad clicks in the user’s default browser. When someone clicks an ad, open the landing page in their default browser rather than navigating your app’s window. Only open links in response to a real click. Block navigations and popups the user didn’t trigger, and block file downloads started by ads.
- Send a standard browser User Agent. Many frameworks add their own name,
and your app’s name, to the User Agent string (for example
Electron/…orMyApp/…). Remove those parts so the string looks like a regular browser. Non-standard User Agents may be flagged as IVT (invalid traffic).
Electron
rev-utils handles both requirements for you.
Installation
Install the rev-utils library to augment your Electron setup with full compatibility for ads. We may occasionally update the package.Usage
After creating a window withnew BrowserWindow, pass the window and the
electron global into setupRevUtils.
main.js
Under the hood,
setupRevUtils calls two functions on the windowsetupLinkHandlerto open ads (and block malicious behavior!)setUserAgent, which removes non-standard portions of the User Agent string which may trigger IVT (invalid traffic).
Tauri
Build a page on your domain with the RevIQ script and your ad slots (see Frontend), then show it in a child webview that sends a standard User Agent and opens ad clicks in the user’s browser.src-tauri/src/ads.rs
Window::add_child is behind Tauri’s unstable feature. Enable it on tauri
in src-tauri/Cargo.toml: tauri = { version = "2", features = ["unstable"] }.src-tauri/src/ads-init.js
src-tauri/src/main.rs
ads webview only the one command it needs:
src-tauri/capabilities/ads.json
src-tauri/permissions/open-ad-link.toml
Other frameworks
Meet the two requirements with your framework’s own APIs: set a standard browser User Agent on the webview, and send link clicks andwindow.open calls
from ad frames to the system browser, only right after a real click. The Tauri
example above shows the full pattern.
Building with a framework not listed here? It will work as long as it renders
web content. Contact your RevIQ account manager if you need help with setup.