API reference

Every export of the core package.

v0.1.1LibraryPolyForm-Strict-1.0.01 min read

Runtime#

  • new Userscript(options) creates the runtime. Options: id, name, version, isReady, observe, initializationDelay, safetyInterval, clearConsole, storage, ui, openSettings.
  • register(factory) adds a feature. start() boots the runtime.
  • events.on('ready' | 'navigate', listener) subscribes to lifecycle events.

Feature#

  • run() is called on every DOM update.
  • onEnable() and onDisable() are called on transitions.
  • scope releases listeners and timers when the feature is disabled.
  • menuEntries() and commands() feed the userscript menu and any command palette.

Utilities#

  • ScriptStorage and createStorage: get, set, remove, subscribe, bucket.
  • createLogger(name): banner, info, success, warning, error, errorOnce.
  • DOM: getElement (XPath), query, queryAll, createElement, h, createUiMarker.
  • Async: sleep, waitFor, isAbort.
  • Network: request, getText, getJson.
  • Page: getPageWindow, FetchSpy.
  • Misc: injectStyle, removeStyle, MenuController, Scope, Emitter, repoUrls.

Build#

From @nolly/core/build: createHeader(meta), buildUserscript(options), fileNames(slug).

Edit this page on GitHub

Search documentation

Jump to any page or section.

Better Perplexity
Install
Features
Shortcuts
Community prompts
Privacy
Troubleshooting
Built on the shared core
Development
License
Getting started
Install
Take the tour
Where things are
Turn modules on and off
Usage tracking
What the badge shows
Which mode is shown
Refill estimates
Refill estimates
When the numbers look wrong
Long messages
The size meter
Big messages
Sending in parts
Attaching as a file
Accuracy
Prompts and batches
Prompt library
Placeholders
Community prompts
Batch Runner
Code blocks and export
Code blocks
Exporting a thread
Citation styles
Shortcuts and settings
Default shortcuts
Enter as newline
Command palette
Selection toolbar
Layout
Architecture
What the core provides
What stays in Better Perplexity
Compatibility
Building from source
Troubleshooting
A button is missing
Usage shows free-tier numbers
My draft disappeared
Export fails
Updates do not arrive
The build cannot find @nolly/core
Reporting a bug
Changelog
[1.0.3] - 2026-11-09
Fixed
Changed
[1.0.2] - 2026-11-09
Changed
[1.0.1] - 2026-11-09
Changed
Fixed
[1.0.0] - 2026-11-08
Added
Community prompts
Suggest a prompt
Userscript Core
What you get
Quick start
Getting started
Scaffold
A feature
Wire it up
Cleanup
API reference
Runtime
Feature
Utilities
Build
Build and release
Changelog
0.1.1
0.1.0