Since JS is dynamical language just rewrite original functions.
var originalSetItem = localStorage.setItem;
localStorage.setItem = function(){
document.createEvent('Event').initEvent('itemInserted', true, true);
originalSetItem.apply(this, arguments);
}
More Related Contents:
- Why are inline event handler attributes a bad idea in modern semantic HTML?
- jQuery .live() vs .on() method for adding a click event after loading dynamic html
- How to stop event propagation with inline onclick attribute?
- What’s the difference between event.stopPropagation and event.preventDefault?
- How to save an image to localStorage and display it on the next page?
- phantomjs not waiting for “full” page load
- Firing event on DOM attribute change
- How to check whether a Storage item is set?
- Javascript event handler with parameters
- event.preventDefault() vs. return false (no jQuery)
- Getting value of HTML Checkbox from onclick/onchange events
- Watch multiple $scope attributes
- How to unbind a listener that is calling event.preventDefault() (using jQuery)?
- Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
- Javascript: How to detect if a word is highlighted
- How can I execute a function on pressing the enter key in an field?
- How can I listen for a click-and-hold in jQuery?
- Clearing localStorage in javascript?
- Check if localStorage is available
- How do you detect the clearing of a “search” HTML5 input?
- JS Events: hooking on value change event on text inputs
- How to handle an ActiveX event in Javascript
- jQuery events .load(), .ready(), .unload()
- Detect if user clicks inside a circle
- Get the clicked object that triggered jquery blur() event [duplicate]
- Backbone 0.9.9: Difference between listenTo and on
- Prevent onclick action with jQuery
- Update object stored in chrome extension’s local storage
- How to programmatically fire a dblclick event defined with addEventListener?
- jquery/javascript: function(e){…. what is e? why is it needed? what does it actually do/accomplish?