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

app/clipboard

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

text/uri-list MIME type for files

The 'text/uri-list' MIME type is mapped to the operating system's native 'copied files' clipboard format (CF_HDROP on Windows, NSFilenamesPboardType on macOS, and text/uri-list on Linux) rather than being stored as generic text. This allows clipboard entries written by Electron to be pasted as files into native applications like Finder or Explorer, and allows Electron to read files copied from those applications. The payload is an RFC 2483 URI list with one file:// URI per line separated by CRLF.

Converting paths to file:// URIs for clipboard

Use url.pathToFileURL() from Node.js to convert an absolute path into a file:// URI for use in the text/uri-list MIME type. Although RFC 2483 permits any URI scheme, the text/uri-list format is files-only and non-file:// URIs are ignored.

text/uri-list reading contains absolute paths

When reading files from the clipboard via getType('text/uri-list'), the resolved file:// URIs contain the real absolute paths of the files. This is different from the renderer's navigator.clipboard, which sanitizes file paths for privacy reasons. This is possible because the clipboard API is a privileged main-process API.

Cookie Object structure

A Cookie Object has the following properties: name (string, required) - the name of the cookie; value (string, required) - the value of the cookie; domain (string, optional) - the domain of the cookie, normalized with a preceding dot for subdomain validity; hostOnly (boolean, optional) - whether the cookie is host-only, true only if no domain was passed; path (string, optional) - the path of the cookie; secure (boolean, optional) - whether the cookie is marked as secure; httpOnly (boolean, optional) - whether the cookie is marked as HTTP only; session (boolean, optional) - whether the cookie is a session cookie or persistent cookie with expiration date; expirationDate (Double, optional) - the expiration date as the number of seconds since UNIX epoch, not provided for session cookies; sameSite (string, required) - the Same Site policy applied to this cookie, can be 'unspecified', 'no_restriction', 'lax', or 'strict'.

Give your agent this brain