Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@coding-blocks/monitorer
Advanced tools
Your secret weapon for exam integrity. With precise monitoring, ensure every test is fair and free from dishonesty. Elevate academic standards effortlessly with Monitorer.
Monitorer is your go-to tool for tracking tab-switches, monitoring face presence, spotting multiple faces, and detecting window resizing. Keep exams fair and focused with ease.
https://monitorer-playground.codingblocks.com
npm install @coding-blocks/monitorer
import Monitorer from "@coding-blocks/monitorer";
// create a monitorer instance
const monitorerInstance = new Monitorer();
async function init() {
// enable the services you want to track
await monitorerInstance.enable({
tabSwitch: true,
noFace: true,
});
}
// listen for events fired on violation
window.addEventListener("monitorerfault", (e) => {
if (e.code === "TAB_SWITCHED") {
}
if (e.code === "NO_FACE_DETECTED") {
}
});
init();
Monitorer
instanceTo use monitorer, you have to create a Monitorer
instance
import Monitorer from "@coding-block/monitorer";
const monitorerInstance = new Monitorer();
Monitorers
You can enable any or all of the four detectors (we call them monitorers
) using the enable()
method on the Monitorer
instance.
tabSwitch
noFace
multipleFaces
windowResize
rightClick
keyboard
// Enable tab switch and window resize detection
await monitorerInstance.enable({
tabSwitch: true,
windowResize: true,
});
To enable all the monitorers
, do not pass anything to enable()
// Enable all the monitorers
await monitorerInstance.enable();
🚧
enable()
is an asynchronous method.
type enable = (options?: MonitorerEnableOptions): Promise<void>;
type MonitorerEnableOptions = {
tabSwitch?: true; // enable tab switch detection
windowResize?: true; // enable window resize detection
windowMove?: true; // enable window move detection
noFace?: true; // enable no face detection
multipleFaces?: true // enable multiple faces detection
noise?: { // enable noise detection
volume: number
}
rightClick?: true // enable right click detection
keyboard?: { // enable keyboard events detection
copy?: true, // enable keyboard copy detection
paste?: true, // enable keyboard paste detection
console?: true // enable keyboard console detection
}
}
Monitorer Events
After enabling monitorers you can listen to thw following events on the window
object.
Event name | Description | Event Type |
---|---|---|
monitorersuccess | Success event | MonitorerSuccessEvent |
monitorerfault | Fault event (Dispatched when violation occurs) | MonitorerFaultEvent |
monitorererror | Error event (Dispatched when something went wrong) | MonitorerErrorEvent |
monitorersuccess
// javascript
window.addEventListener("monitorersuccess", (e) => {
console.log(e);
});
// typescript
window.addEventListener("monitorersuccess", ((
e: CustomEvent<MonitorerSuccessEvent>
) => {
console.log(e);
}) as EventListener);
type MonitorerSuccessEvent = {
name: "monitorersuccess";
message: string;
code: "MONITORER_ENABLED" | "MONITORERE_DISABLED";
};
type MonitorerFaultEvent =
| {
name: "monitorerfault";
code: "TAB_SWITCHED" | "WINDOW_RESIZED";
message: string;
}
| {
name: "monitorerfault";
code: "NO_FACE_DETECTED" | "MULTIPLE_FACES_DETECTED";
message: string;
imageBlob: Blob | null;
};
type MonitorerErrorEvent = {
name: "monitorererror";
code: string;
message: string;
};
Monitorers
Similar to Enabling
Monitorers
You can disable any or all of the four detectors (we call them monitorers
) using the disable()
method on the Monitorer
instance.
tabSwitch
noFace
multipleFaces
windowResize
rightClick
keyboard
// Disable tab switch and window resize detection
monitorerInstance.disable({
tabSwitch: true,
windowResize: true,
});
To disable all the monitorers
, do not pass anything to disable()
// Disable all the monitorers
monitorerInstance.disable();
type disable = (options?: MonitorerDisableOptions): Promise<void>;
type MonitorerDisableOptions = {
tabSwitch?: true; // disable tab switch detection
windowResize?: true; // disable window resize detection
windowMove?: true; // disable window move detection
noFace?: true; // disable no face detection
multipleFaces?: true // disable multiple faces detection
noise?: true // disable noise detection
rightClick?: true // disable right click detection
keyboard?: true // disable keyboard event detection
}
Made with ❤️ and 🧠 @CodingBlocks
FAQs
monitor and restrict activity on a webpage
The npm package @coding-blocks/monitorer receives a total of 0 weekly downloads. As such, @coding-blocks/monitorer popularity was classified as not popular.
We found that @coding-blocks/monitorer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.