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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 return true; | 318 return true; |
319 }, | 319 }, |
320 | 320 |
321 _onReload: function(message) | 321 _onReload: function(message) |
322 { | 322 { |
323 var options = /** @type ExtensionReloadOptions */ (message.options || {}
); | 323 var options = /** @type ExtensionReloadOptions */ (message.options || {}
); |
324 NetworkAgent.setUserAgentOverride(typeof options.userAgent === "string"
? options.userAgent : ""); | 324 NetworkAgent.setUserAgentOverride(typeof options.userAgent === "string"
? options.userAgent : ""); |
325 var injectedScript; | 325 var injectedScript; |
326 if (options.injectedScript) | 326 if (options.injectedScript) |
327 injectedScript = "(function(){" + options.injectedScript + "})()"; | 327 injectedScript = "(function(){" + options.injectedScript + "})()"; |
328 PageAgent.reload(!!options.ignoreCache, injectedScript); | 328 var preprocessingScript = options.preprocessingScript; |
| 329 PageAgent.reload(!!options.ignoreCache, injectedScript, preprocessingScr
ipt); |
329 return this._status.OK(); | 330 return this._status.OK(); |
330 }, | 331 }, |
331 | 332 |
332 _onEvaluateOnInspectedPage: function(message, port) | 333 _onEvaluateOnInspectedPage: function(message, port) |
333 { | 334 { |
334 /** | 335 /** |
335 * @param {?Protocol.Error} error | 336 * @param {?Protocol.Error} error |
336 * @param {RuntimeAgent.RemoteObject} resultPayload | 337 * @param {RuntimeAgent.RemoteObject} resultPayload |
337 * @param {boolean=} wasThrown | 338 * @param {boolean=} wasThrown |
338 */ | 339 */ |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 | 901 |
901 WebInspector.extensionServer = new WebInspector.ExtensionServer(); | 902 WebInspector.extensionServer = new WebInspector.ExtensionServer(); |
902 | 903 |
903 window.addExtension = function(page, name) | 904 window.addExtension = function(page, name) |
904 { | 905 { |
905 WebInspector.extensionServer._addExtension({ | 906 WebInspector.extensionServer._addExtension({ |
906 startPage: page, | 907 startPage: page, |
907 name: name, | 908 name: name, |
908 }); | 909 }); |
909 } | 910 } |
OLD | NEW |