OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return true; | 319 return true; |
320 }, | 320 }, |
321 | 321 |
322 _onReload: function(message) | 322 _onReload: function(message) |
323 { | 323 { |
324 var options = /** @type ExtensionReloadOptions */ (message.options || {}
); | 324 var options = /** @type ExtensionReloadOptions */ (message.options || {}
); |
325 NetworkAgent.setUserAgentOverride(typeof options.userAgent === "string"
? options.userAgent : ""); | 325 NetworkAgent.setUserAgentOverride(typeof options.userAgent === "string"
? options.userAgent : ""); |
326 var injectedScript; | 326 var injectedScript; |
327 if (options.injectedScript) | 327 if (options.injectedScript) |
328 injectedScript = "(function(){" + options.injectedScript + "})()"; | 328 injectedScript = "(function(){" + options.injectedScript + "})()"; |
329 PageAgent.reload(!!options.ignoreCache, injectedScript); | 329 var preprocessingScript = options.preprocessingScript; |
| 330 PageAgent.reload(!!options.ignoreCache, injectedScript, preprocessingScr
ipt); |
330 return this._status.OK(); | 331 return this._status.OK(); |
331 }, | 332 }, |
332 | 333 |
333 _onEvaluateOnInspectedPage: function(message, port) | 334 _onEvaluateOnInspectedPage: function(message, port) |
334 { | 335 { |
335 /** | 336 /** |
336 * @param {?Protocol.Error} error | 337 * @param {?Protocol.Error} error |
337 * @param {RuntimeAgent.RemoteObject} resultPayload | 338 * @param {RuntimeAgent.RemoteObject} resultPayload |
338 * @param {boolean=} wasThrown | 339 * @param {boolean=} wasThrown |
339 */ | 340 */ |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 | 899 |
899 WebInspector.extensionServer = new WebInspector.ExtensionServer(); | 900 WebInspector.extensionServer = new WebInspector.ExtensionServer(); |
900 | 901 |
901 window.addExtension = function(page, name) | 902 window.addExtension = function(page, name) |
902 { | 903 { |
903 WebInspector.extensionServer._addExtension({ | 904 WebInspector.extensionServer._addExtension({ |
904 startPage: page, | 905 startPage: page, |
905 name: name, | 906 name: name, |
906 }); | 907 }); |
907 } | 908 } |
OLD | NEW |