If you don’t mind messing around with the source, you could redefine the property with an accessor.
// original object
var obj = {
someProp: 10
};
// save in another property
obj._someProp = obj.someProp;
// overwrite with accessor
Object.defineProperty(obj, 'someProp', {
get: function () {
return obj._someProp;
},
set: function (value) {
debugger; // sets breakpoint
obj._someProp = value;
}
});
Related Contents:
- How do you launch the JavaScript debugger in Google Chrome?
- Is it possible to display a custom message in the beforeunload popup?
- Find out whether Chrome console is open
- Detecting the onload event of a window opened with window.open
- new Date() is working in Chrome but not Firefox
- How can I set default homepage in FF and Chrome via javascript?
- My very simple Greasemonkey script is not running?
- style.display=’none’ doesn’t work on option tags in chrome, but it does in firefox
- How to set a JavaScript breakpoint from code in Chrome?
- Cryptic “Script Error.” reported in Javascript in Chrome and Firefox
- Using Chrome, how to find to which events are bound to an element
- How to getting browser current locale preference using javascript?
- JavaScript Time Zone is wrong for past Daylight Saving Time transition rules
- How JavaScript closures are garbage collected
- Does execCommand SaveAs work in Firefox?
- Open IE browser in Firefox/Chrome page
- How to make Google Chrome JavaScript console persistent?
- How to set breakpoints in inline Javascript in Google Chrome?
- JavaScript: Is there a way to get Chrome to break on all errors?
- Editing in the Chrome debugger
- Javascript Debugging line by line using Google Chrome
- Why is a function declaration within a condition block hoisted to function scope in Chrome but not Firefox?
- How to show full object in Chrome console
- What happens to code after a javascript redirect (setting window.location.href)?
- how to set DOM Breakpoints in chrome
- Animated gif only loops once in Chrome and Firefox
- How do I print debug messages in the Google Chrome JavaScript Console?
- Add to browser favorites/bookmarks from JavaScript but for all browsers (mine doesn’t work in Chrome)?
- Chrome – Fetch API cannot load file. How to workaround?
- Firebug says “No Javascript on this page”, even though JavaScript does exist on the page
- Chrome javascript debugger breakpoints don’t do anything?
- Get cursor or text position in pixels for input element
- Why are function declarations handled differently in different browsers?
- Is it possible to change javascript variable values while debugging in Google Chrome?
- Javascript: Let user select an HTML element like Firebug?
- Why is array.push sometimes faster than array[n] = value?
- ES2015 import doesn’t work (even at top-level) in Firefox
- Get element CSS property (width/height) value as it was set (in percent/em/px/etc)
- What’s the difference between console.dir and console.log?
- Why am I getting weird result using parseInt in node.js? (different result from chrome js console)
- Executing code at page-level from Background.js and returning the value
- Chrome Extension how to send data from content script to popup.html
- Chrome Autofill/Autocomplete no value for password
- How to include JavaScript file or library in Chrome console?
- Break on a change of variable value
- Chrome extension: Inject JS before page load
- View list of all JavaScript variables in Google Chrome Console
- Cross-domain XMLHttpRequest using background pages
- Proper way to detect WebGL support?
- Uncaught DOMException: Failed to read the ‘cssRules’ property