MentorUiScannerOptions class
Story 1636 — the options of the scan of the pages, set with MentorUiScannerExtensions.AddMentorUiScanner or from the configuration section MentorAgent:Scanner.
On this page
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Scanner. Package: Novior.MentorAgent.Scanner.
public sealed class MentorUiScannerOptions
dotnet add package Novior.MentorAgent.ScannerConstructors
Section titled “Constructors”public MentorUiScannerOptions()
Properties
Section titled “Properties”BrowserPath
Section titled “BrowserPath”public string? BrowserPath { get; set; }
The browser to start, a full path to Edge's or Chrome's executable. null, the default, takes the first Edge or Chrome installed where their installers put them. The scan never downloads one: with none found it does not start, and the log says why.
FrontEndRoutes
Section titled “FrontEndRoutes”public IList<string> FrontEndRoutes { get; set; }
Story 1641 — the routes of the front end of MentorUiScannerOptions.FrontEndUrl, as its router writes them: /orders/:id (React Router, Angular) or /orders/{id}; * and ** are a catch-all, never opened. A route with parameters is opened with the values of MentorUiScannerOptions.RouteParameters, by the route with braces (/orders/{id}). Empty, the default: the scan follows the links of the front end from its first page, those of its own origin, without query or fragment, and none inside data-mentor-exclude.
FrontEndUrl
Section titled “FrontEndUrl”public Uri? FrontEndUrl { get; set; }
Story 1641 — the address of the application's front end, when the pages are not this host's: a React or Angular application served by its own server, the development server of Vite or of the Angular CLI for instance (http://localhost:5173/). With it the scan reads the front end's pages instead of the host's (page.scan-front-end): those of MentorUiScannerOptions.FrontEndRoutes, or, with none, those its links reach from its first page. It reads them with no user, since the scan's user signs in to this host only: MentorUiScannerOptions.Roles is not used. Each page is read at every scan, since no code of the host tells whether it changed. An http or https address without a query or a fragment; anything else, and the scan does not start.
public bool Full { get; set; }
Reads every page again. false, the default, reads again only the pages whose code, or whose layout's, changed since the last scan, and those the manifest does not have; the others keep what the manifest says. A component a page renders is not part of that check: set this, or delete obj/mentor-ui-scan.state.json, after changing one. Either way the manifest is written only when what it says changes.
ManifestPath
Section titled “ManifestPath”public string? ManifestPath { get; set; }
Where the manifest is written. null, the default, is the project's mentor-ui-manifest.json, or the file its MentorUiManifest property names: the one the targets of Novior.MentorAgent embed in the application at the next build.
PageTimeout
Section titled “PageTimeout”public TimeSpan PageTimeout { get; set; }
How long the scan waits for a page to load and settle before it reads it. 15 seconds by default.
public IList<string> Roles { get; set; }
The roles to scan the pages as. The scan reads every page with no user, then once for each role here as a user of its own that has that role alone, signed in with a one-time token, in Development and from this machine only. An element seen with no user needs no role in the manifest; one seen only with some of these roles needs any one of them. Empty, the default, reads with no user only. The scan clicks on what opens tabs, menus and collapsed sections, as each of these users, on the data of the development environment.
RouteParameters
Section titled “RouteParameters”public IDictionary<string, IDictionary<string, string>> RouteParameters { get; set; }
The values of the route parameters, by route, to open a page whose route has parameters: for the page /orders/{id:int}, { "/orders/{id}": { "id": "1" } }. The key is the route with each parameter's name only, since a configuration key cannot hold the colon of a constraint. Each value is escaped and stays in the page's path; a value of more than 200 characters, with a control character, or that is . or .., is not used. A route with a parameter that has no value, no default and is not optional is not opened, and stays to scan.
Fields
Section titled “Fields”SectionName
Section titled “SectionName”public const string SectionName = "MentorAgent:Scanner"
The configuration section the options are read from.
