Free tools Windows power users keep installed
One-click scans. No signup required.
Attractive.js custom actions can start as a short js: expression, become a registered function when the behavior needs a name, and grow into a class with run() when it needs more structure. Functions and classes use the same addActions registration pattern. One important limit: the js: shortcut uses new Function(), so it requires unsafe-eval in your site’s Content Security Policy (CSP).
Choose an action form that fits the behavior
The practical progression is based on how much structure the behavior needs—not on separate registration systems. The Attractive.js author describes the options in a custom-actions guide; the examples below reflect that guide rather than independent testing.
As an Amazon Associate I earn from qualifying purchases.
| Form | Best fit | Main consideration |
|---|---|---|
js: expression |
A short, one-off expression | Compact, but uses new Function() and requires unsafe-eval in the CSP. |
| Registered function | A named behavior with modest logic that may be reused | Receives the element and a context object; register it through addActions. |
Class with run() |
A larger behavior that benefits from instance structure or helpers | Uses the same addActions configuration; the optional Action base class provides additional helpers. |
Start small with a js: expression
For a tiny behavior that does not merit a named action, the guide describes using js: to evaluate a JavaScript expression on the element. It goes through the regular action pipeline, so event handling and attributes such as data-debounce and data-delay still apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →The trade-off is security policy: the implementation uses new Function(). As the author puts it, “It runs new Function() under the hood (which needs unsafe-eval in your CSP).” If your CSP does not allow unsafe-eval, do not use this shortcut; move the behavior to a registered function or class instead.
#1 Best Overall
Promote reusable logic to a registered function
When an expression has grown beyond a one-off, give it a name and register it as an action. The guide’s example shape is a function such as sharePage(element, { dataset }), added through Attractive.activate({ addActions: { sharePage } }).
The function receives the triggering element and a context object. The documented context includes:
Rank #2
value: the action value.targetandtargets: target information.event: the event associated with the action.dataset: the element’s data attributes.
This keeps a modest action easy to reuse without adding class structure it does not yet need. The central API promise is consistent registration: a function is supplied through addActions, just as a class is.
Use a class when the action needs structure
For behavior that has grown enough to benefit from instance methods or helpers, the guide describes registering a class with a run() method through the same addActions configuration. The instance receives element and options.
An optional Action base class adds value, dataset, and a dispatchEvent helper. In the guide’s Reorder example, the action uses that helper to emit reorder:done with IDs. That illustrates the class form’s value: it offers a place for a larger action’s behavior and supporting methods, rather than requiring every action to begin as a class.
Organize several actions without changing registration
For a small collection of actions, the author suggests keeping each in its own file, gathering the imports in a barrel module, and passing the resulting object to Attractive.activate({ addActions: actions }). This is an organizational option, not a required project convention. The important point is that the registration interface remains the same as the collection grows.
Rank #4
Handle action lifecycle and errors
The guide describes three hooks for managing action execution:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
beforeActionruns before each action; returningfalsecancels it.afterActionruns after a successful action.onErrorhandles an action that throws.
According to the author, an error does not prevent the rest of a chained action from continuing, and a global Attractive.onError fallback can be used for monitoring integration. These are claims from the implementation guide, not independently verified behavior; check the version and documentation you use before relying on them in a critical flow.
Best Value
Keep adjacent features separate from the action ladder
The same guide mentions optional keyboard support, including event keys and global hotkeys; integration with native browser constraint validation; a shared JSON reactive store with text bindings; and Attractive Element, a custom-element base class that scopes actions and targets. These are related capabilities, not prerequisites for choosing between an inline expression, a function, and a class.
A separate overview published on 10 September 2026 described Attractive.js 1.0.0 as a pre-release at that time, introduced @action and @target syntax and bundled actions, and positioned the library as a lightweight declarative option for small interactions in static and server-rendered apps. That is historical publication-time status, not confirmation of the current release state. The overview also reported a full build of about 7 KB gzipped and a core build below 5 KB with bundler qualification; those are author-reported figures, not independent benchmarks, and they are not necessary to choose an action form.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




