Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4182)

Unified Diff: ceee/ie/plugin/scripting/ceee_bootstrap.js

Issue 4997002: IE CEEE: Explicitly assign window properties/methods into the script host glo... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ceee/ie/plugin/scripting/ceee_bootstrap.js
===================================================================
--- ceee/ie/plugin/scripting/ceee_bootstrap.js (revision 66115)
+++ ceee/ie/plugin/scripting/ceee_bootstrap.js (working copy)
@@ -111,8 +111,61 @@
// Delete the ceee namespace from globals.
delete ceee;
-}
+};
+ceee.initGlobals_ = function() {
+ // We expose a subset of the Window interface defined at
+ // http://www.w3.org/TR/html5/browsers.html#the-window-object
+ // to the global namespace. We purposely skip all event handler
+ // attributes (e.g. onclick).
+
+ // Browsing context.
+ self = window.self;
+ document = window.document;
+ name = window.name;
+ location = window.location;
+ history = window.history;
+ undoManager = window.undoManager;
+ locationbar = window.locationbar;
+ menubar = window.menubar;
+ scrollbars = window.scrollbars;
+ statusbar = window.statusbar;
+ toolbar = window.toolbar;
+ close = window.close;
+ stop = window.stop;
+ focus = window.focus;
+ blur = window.blur;
+
+ // Other browsing contexts.
+ frames = window.frames;
+ length = window.length;
+ top = window.top;
+ opener = window.opener;
+ parent = window.parent;
+ frameElement = window.frameElement;
+ open = window.open;
+
+ // User agent.
+ navigator = window.navigator;
+ applicationCache = window.applicationCache;
+
+ // User prompts.
+ alert = window.alert;
+ confirm = window.confirm;
+ prompt = window.prompt;
+ print = window.print;
+ showModalDialog = window.showModalDialog;
+
+ // EventTarget interface.
+ addEventListener = window.addEventListener;
+ removeEventListener = window.removeEventListener;
+ dispatchEvent = window.dispatchEvent;
+
+ // Old IE event model.
+ attachEvent = window.attachEvent;
+ detachEvent = window.detachEvent;
+};
+
console.log = console.log || function (msg) {
if (nativeContentScriptApi)
nativeContentScriptApi.Log("info", msg);
« no previous file with comments | « no previous file | ceee/ie/plugin/scripting/content_script_manager.cc » ('j') | ceee/ie/plugin/scripting/content_script_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698