new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

web-contents/search

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

contents.findInPage(text, options) - find text in page

Starts a request to find all matches for the text in the web page. The result of the request can be obtained by subscribing to the 'found-in-page' event. Returns Integer - the request ID used for the request. Parameters: text (string, required) - content to be searched (must not be empty), options (Object, optional) with forward (boolean, optional, defaults to true) - whether to search forward or backward, findNext (boolean, optional, defaults to false) - whether to begin a new text finding session with this request (should be true for initial requests, false for follow-up requests), matchCase (boolean, optional, defaults to false) - whether search should be case-sensitive.

contents.stopFindInPage(action) - stop find in page

Stops any findInPage request for the webContents with the provided action. Parameters: action (string) - specifies the action to take place when ending the findInPage request. Valid values: 'clearSelection' (clear the selection), 'keepSelection' (translate the selection into a normal selection), 'activateSelection' (focus and click the selection node).

stopFindInPage() example

const win = new BrowserWindow() win.webContents.on('found-in-page', (event, result) => { if (result.finalUpdate) win.webContents.stopFindInPage('clearSelection') }) const requestId = win.webContents.findInPage('api') console.log(requestId)

Give your agent this brain