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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 }, | 416 }, |
417 | 417 |
418 _onReload: function(message) | 418 _onReload: function(message) |
419 { | 419 { |
420 var options = /** @type {!ExtensionReloadOptions} */ (message.options ||
{}); | 420 var options = /** @type {!ExtensionReloadOptions} */ (message.options ||
{}); |
421 | 421 |
422 WebInspector.multitargetNetworkManager.setUserAgentOverride(typeof optio
ns.userAgent === "string" ? options.userAgent : ""); | 422 WebInspector.multitargetNetworkManager.setUserAgentOverride(typeof optio
ns.userAgent === "string" ? options.userAgent : ""); |
423 var injectedScript; | 423 var injectedScript; |
424 if (options.injectedScript) | 424 if (options.injectedScript) |
425 injectedScript = "(function(){" + options.injectedScript + "})()"; | 425 injectedScript = "(function(){" + options.injectedScript + "})()"; |
426 var preprocessingScript = options.preprocessingScript; | |
427 // Reload main frame. | 426 // Reload main frame. |
428 var target = WebInspector.targetManager.mainTarget(); | 427 var target = WebInspector.targetManager.mainTarget(); |
429 target.resourceTreeModel.reloadPage(!!options.ignoreCache, injectedScrip
t, preprocessingScript); | 428 target.resourceTreeModel.reloadPage(!!options.ignoreCache, injectedScrip
t); |
430 return this._status.OK(); | 429 return this._status.OK(); |
431 }, | 430 }, |
432 | 431 |
433 _onEvaluateOnInspectedPage: function(message, port) | 432 _onEvaluateOnInspectedPage: function(message, port) |
434 { | 433 { |
435 /** | 434 /** |
436 * @param {?Protocol.Error} error | 435 * @param {?Protocol.Error} error |
437 * @param {?WebInspector.RemoteObject} remoteObject | 436 * @param {?WebInspector.RemoteObject} remoteObject |
438 * @param {boolean=} wasThrown | 437 * @param {boolean=} wasThrown |
439 * @this {WebInspector.ExtensionServer} | 438 * @this {WebInspector.ExtensionServer} |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); | 1074 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); |
1076 } | 1075 } |
1077 | 1076 |
1078 /** | 1077 /** |
1079 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1078 * @typedef {{code: string, description: string, details: !Array.<*>}} |
1080 */ | 1079 */ |
1081 WebInspector.ExtensionStatus.Record; | 1080 WebInspector.ExtensionStatus.Record; |
1082 | 1081 |
1083 WebInspector.extensionAPI = {}; | 1082 WebInspector.extensionAPI = {}; |
1084 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1083 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
OLD | NEW |