I am working on code that is entered on web pages (using a browser add-on or with a script tag).
The problem is that we want to use a global objects and variables such as JSON, window.location, String.split, etc. and their implementation can be changed on the web page. This can cause our code to crash, and this is a security issue.
Example:
>>> String.prototype.split = function() { return 'foo'; };
function()
>>> 'a,b,c'.split(',');
"foo"
So, is there a way to access the default implementation and functions of the browser, as it was before they were changed? It does not have to be standard, I just want the functionality to exist.
source
share