diff options
Diffstat (limited to 'chrome/renderer/resources/extensions')
-rw-r--r-- | chrome/renderer/resources/extensions/platform_app.css | 4 | ||||
-rw-r--r-- | chrome/renderer/resources/extensions/platform_app.js | 40 |
2 files changed, 44 insertions, 0 deletions
diff --git a/chrome/renderer/resources/extensions/platform_app.css b/chrome/renderer/resources/extensions/platform_app.css index fddbe16..3216539 100644 --- a/chrome/renderer/resources/extensions/platform_app.css +++ b/chrome/renderer/resources/extensions/platform_app.css @@ -1,4 +1,8 @@ /* + * Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * * A style sheet for Chrome platform apps. */ diff --git a/chrome/renderer/resources/extensions/platform_app.js b/chrome/renderer/resources/extensions/platform_app.js new file mode 100644 index 0000000..3660a81 --- /dev/null +++ b/chrome/renderer/resources/extensions/platform_app.js @@ -0,0 +1,40 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var errorMsg = 'Not available for platform apps.'; +var stub = function() { throw errorMsg; }; + +// Disable document.open|close|write. +document.open = stub; +document.close = stub; +document.write = stub; + +// Disable history. +window.history = { + open: stub, + back: stub, + forward: stub, + go: stub, + pushState: stub, + replaceState: stub, + get length() { throw errorMsg; }, + get state() { throw errorMsg; } +}; + +// Disable find. +window.find = stub; + +// Disable modal dialogs. +window.alert = stub; +window.confirm = stub; +window.prompt = stub; + +// Disable window.*bar. +var stubBar = { get visible() { throw errorMsg; } }; +window.locationbar = stubBar; +window.menubar = stubBar; +window.personalbar = stubBar; +window.scrollbars = stubBar; +window.statusbar = stubBar; +window.toolbar = stubBar; |