OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 this.onResourceAdded = new EventSink(events.ResourceAdded, dispatchResourceE
vent); | 709 this.onResourceAdded = new EventSink(events.ResourceAdded, dispatchResourceE
vent); |
710 this.onResourceContentCommitted = new EventSink(events.ResourceContentCommit
ted, dispatchResourceContentEvent); | 710 this.onResourceContentCommitted = new EventSink(events.ResourceContentCommit
ted, dispatchResourceContentEvent); |
711 } | 711 } |
712 | 712 |
713 InspectedWindow.prototype = { | 713 InspectedWindow.prototype = { |
714 reload: function(optionsOrUserAgent) | 714 reload: function(optionsOrUserAgent) |
715 { | 715 { |
716 var options = null; | 716 var options = null; |
717 if (typeof optionsOrUserAgent === "object") { | 717 if (typeof optionsOrUserAgent === "object") { |
718 options = optionsOrUserAgent; | 718 options = optionsOrUserAgent; |
719 if (options.preprocessingScript) | |
720 console.warn("Please avoid using 'preprocessingScript' option to
chrome.devtools.inspectedWindow.reload(), support for it will be removed soon."
); | |
721 } else if (typeof optionsOrUserAgent === "string") { | 719 } else if (typeof optionsOrUserAgent === "string") { |
722 options = { userAgent: optionsOrUserAgent }; | 720 options = { userAgent: optionsOrUserAgent }; |
723 console.warn("Passing userAgent as string parameter to inspectedWind
ow.reload() is deprecated. " + | 721 console.warn("Passing userAgent as string parameter to inspectedWind
ow.reload() is deprecated. " + |
724 "Use inspectedWindow.reload({ userAgent: value}) instea
d."); | 722 "Use inspectedWindow.reload({ userAgent: value}) instea
d."); |
725 } | 723 } |
726 extensionServer.sendRequest({ command: commands.Reload, options: options
}); | 724 extensionServer.sendRequest({ command: commands.Reload, options: options
}); |
727 }, | 725 }, |
728 | 726 |
729 /** | 727 /** |
730 * @return {?Object} | 728 * @return {?Object} |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 { | 1004 { |
1007 return "(function(injectedScriptId){ " + | 1005 return "(function(injectedScriptId){ " + |
1008 "var extensionServer;" + | 1006 "var extensionServer;" + |
1009 defineCommonExtensionSymbols.toString() + ";" + | 1007 defineCommonExtensionSymbols.toString() + ";" + |
1010 injectedExtensionAPI.toString() + ";" + | 1008 injectedExtensionAPI.toString() + ";" + |
1011 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" + | 1009 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" + |
1012 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + | 1010 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + |
1013 "return {};" + | 1011 "return {};" + |
1014 "})"; | 1012 "})"; |
1015 } | 1013 } |
OLD | NEW |