New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

d-before-unload

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d-before-unload - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

14

index.js

@@ -6,3 +6,11 @@ module.exports = BeforeUnload;

BeforeUnload.prototype.create = function(model, dom) {
dom.on('beforeunload', window, function(e) {
// Don't do anything until the user makes some kind of mutation
model.root.once('all', '**', function() {
// Thereafter, stop the user from leaving the page whenever a change might be pending
dom.on('beforeunload', window, listenerFn(model));
});
};
function listenerFn(model) {
return function beforeunloadListener(e) {
if (!model.hasPending()) return;

@@ -13,3 +21,3 @@ var confirmationMessage = model.get('message') ||

return confirmationMessage;
});
};
};
}
{
"name": "d-before-unload",
"description": "Derby component to stop page from unloading when it has pending operations",
"version": "0.1.0",
"version": "0.1.1",
"main": "index.js",

@@ -6,0 +6,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc