
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
global-event-handlers-map
Advanced tools
GlobalEventHandlers mapped out completely - cross browsers
Using this powerful little tool will map out for you all Global Event Handlers in any browser you'd wish to execute it on.
npm install global-event-handlers-map --save
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap();
a map of all global event listeners in the browser in the following format:
{
'OBJECT': [
'onEVENT1',
'onEVENT2',
'onEVENT3'
]
}
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap('WebSocket');
(gehsMap == {
"WebSocket": [
"onopen",
"onerror",
"onclose",
"onmessage"
]
});
filter
(first optional argument)allows you to pass a string that must exist within the object in order for it to make the final result map:
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap('*'); // will return a non-filtered map
const gehsMap = getGlobalEventsHandlersMap('HTML'); // will return a map that only contains objects that contain the string 'HTML' (such as 'HTMLBodyElement')
const gehsMap = getGlobalEventsHandlersMap('Doc'); // will return a map that only contains objects that contain the string 'Doc' (such as 'Document')
default value: '*'
hasOwnProperty
(second optional argument)allows you to pass a boolean that indicates whether iterated object must has iterated property as its own property or not:
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap('*', true); // will return a map with objects and global event handlers properties that are the object's own properties
const gehsMap = getGlobalEventsHandlersMap('*', false); // will return a map with objects and global event handlers properties - whether the properties are the object's own properties or not
default value: true
noEmptyArrays
(third optional argument)allows you to pass a boolean that indicates whether final result object should contain objects that have zero global event handlers or not:
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap('*', true, true); // will return a map with objects and global event handlers properties only if the object even has any global event handlers
const gehsMap = getGlobalEventsHandlersMap('*', true, false); // will return a map with objects and global event handlers properties whether the object has any global event handlers or not
default value: false
debug
(fourth optional argument)allows you to pass a boolean that indicates whether to run module in debug mode or not. debug mode just logs errors in case any are thrown:
const getGlobalEventsHandlersMap = require('global-event-handlers-map');
const gehsMap = getGlobalEventsHandlersMap('*', true, true, true); // will run in debug mode
const gehsMap = getGlobalEventsHandlersMap('*', true, false, false); // will not run in debug mode
default value: false
FAQs
GlobalEventHandlers mapped out completely cross browsers
The npm package global-event-handlers-map receives a total of 2 weekly downloads. As such, global-event-handlers-map popularity was classified as not popular.
We found that global-event-handlers-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.