| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var $console = window.console; | 5 var $console = window.console; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Returns a function that logs a 'not available' error to the console and | 8 * Returns a function that logs a 'not available' error to the console and |
| 9 * returns undefined. | 9 * returns undefined. |
| 10 * | 10 * |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 // Disable onunload, onbeforeunload. | 199 // Disable onunload, onbeforeunload. |
| 200 disableSetters(Window.prototype, 'window', ['onbeforeunload', 'onunload']); | 200 disableSetters(Window.prototype, 'window', ['onbeforeunload', 'onunload']); |
| 201 var windowAddEventListener = Window.prototype.addEventListener; | 201 var windowAddEventListener = Window.prototype.addEventListener; |
| 202 Window.prototype.addEventListener = function(type) { | 202 Window.prototype.addEventListener = function(type) { |
| 203 if (type === 'unload' || type === 'beforeunload') | 203 if (type === 'unload' || type === 'beforeunload') |
| 204 generateDisabledMethodStub(type)(); | 204 generateDisabledMethodStub(type)(); |
| 205 else | 205 else |
| 206 return $Function.apply(windowAddEventListener, window, arguments); | 206 return $Function.apply(windowAddEventListener, window, arguments); |
| 207 }; | 207 }; |
| OLD | NEW |