This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/knowledge-base/override-user-agent.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Override user agent in PDF viewer | Nutrient

It’s possible to force Nutrient to use the Web version and not the Electron version when loading. This is accomplished by injecting some code that monkey patches navigator.userAgent to not include Electron/ in the string.

Here’s an example that uses the current Chrome User Agent:

const chromeUserAgent =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36";
Object.defineProperty(navigator, "userAgent", {
get: () => chromeUserAgent
});

This has been tested with Nutrient Web SDK 2019.4.1.

If you want to use the Electron API to modify the user agent string from the backend, refer to the Electron documentation(opens in a new tab).