Make domdistiller.js not modify `window`
commit1cdeaddc33f8053eb8f194c5d757ac76fa270078
authorcjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 10 Jun 2014 23:30:16 +0000 (10 23:30 +0000)
committercjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 10 Jun 2014 23:30:16 +0000 (10 23:30 +0000)
tree65b0daf6a8157580714d328c84e1def33501c2ee
parent32eced9c85686fbfee1133865a3ffba1bec519ba
Make domdistiller.js not modify `window`

Currently when we inject javascript into the page, we clobber a whole
bunch of names on the page's window object.

This moves the included javascript into the anonymous function so that
defining a function/var doesn't add that name to the window object and
also passes a new object with the window as prototype as the 'window'
variable to that function so that if it explicitly modifies window it
will modify the new object instead.

NOTRY=true

Review URL: https://codereview.chromium.org/320113002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276203 0039d316-1c4b-4281-b951-d872f2087c98
components/dom_distiller/core/javascript/domdistiller.js