Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
ajax-hacker
Advanced tools
Hack your ajax
Ajax-hacker supply a function that can hack ajax object(XMLHttpRequest, ActiveXObject and XDomainRequest), modify it and add hooks on it. Others who use ajax object will not even notice it.
Actually I use it in a front-end performance monitoring project.
npm install ajax-hacker --save
You can import ajax-hacker in both AMD and CommonJS way
var ajaxHacker = require('ajax-hacker')
Or you can just link ajax-hacker with a script tag, In this way, an Object called ajaxHacker have been insert into global object.
<script src="./ajax-hacker.js"></script>
And you can use it like this below:
ajaxHacker({
responseType: 'json',
timeout: 3000,
withCredentials: false,
onabord: function (e, next) {
console.log('hacker onabord: ', e, this)
next()
},
onerror: function (e, next) {
console.log('hacker onerror: ', e, this)
next()
},
onload: function (e, next) {
console.log('hacker onload: ', e, this)
next()
},
onloadend: function (e, next) {
console.log('hacker onloadend: ', e, this)
next()
},
onloadstart: function (e, next) {
console.log('hacker onloadstart: ', e, this)
next()
},
onprogress: function (e, next) {
console.log('hacker progress ', e, this)
next()
},
ontimeout: function (e, next) {
console.log('hacker timeout ', e, this)
next()
},
upload: {
// except onreadystatechange, beforeOpen, beforeSend and beforeAbord, upload object support the same hooks as xhr object
onprogress: function (e, next) {
console.log('hacker upload onprogress', e)
next()
}
// ...etc
},
onreadystatechange: function (e) {
console.log('hacker readystatechange', e, this)
},
beforeOpen: function (next, method, url, async, user, password) {
console.log('beforeOpen ', method, url)
next()
},
beforeSend: function (next, body) {
console.log('beforeSend ', body)
next()
},
beforeAbord: function (next) {
console.log('beforeAbord')
next()
}
}
Now your ajax object will follow your step like a lovely dog.
FAQs
hack your ajax
The npm package ajax-hacker receives a total of 2 weekly downloads. As such, ajax-hacker popularity was classified as not popular.
We found that ajax-hacker 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.