| Index: Source/core/inspector/InjectedScriptSource.js
|
| diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
|
| index d508bc06c9a80536cb22655db9954746bfd27ca8..9a70a5fc247aec77873b9de396d398780ddea020 100644
|
| --- a/Source/core/inspector/InjectedScriptSource.js
|
| +++ b/Source/core/inspector/InjectedScriptSource.js
|
| @@ -1136,6 +1136,58 @@ InjectedScript.prototype = {
|
| setCustomObjectFormatterEnabled: function(enabled)
|
| {
|
| this._customObjectFormatterEnabled = enabled;
|
| + },
|
| +
|
| + /**
|
| + * @param {string} prefix
|
| + * @param {!Error} error
|
| + */
|
| + _logError: function(prefix, error)
|
| + {
|
| + Promise.resolve().then(inspectedGlobalObject.console.error.bind(inspectedGlobalObject.console, prefix + error.message));
|
| + },
|
| +
|
| + /**
|
| + * @param {!Object} object
|
| + * @return {!Array<!{type: string, listener: function(), useCapture: boolean}>}
|
| + */
|
| + frameworkUserEventListeners: function(object)
|
| + {
|
| + return this._callCustomGettersOnGlobalObject("devtoolsFrameworkUserEventListeners", object, "Getting framework user event listeners failed: ");
|
| + },
|
| +
|
| + /**
|
| + * @param {!Object} object
|
| + * @return {!Set<function()>}
|
| + */
|
| + frameworkInternalEventHandlers: function(object)
|
| + {
|
| + return new Set(/** @type {!Array<function()>} */(this._callCustomGettersOnGlobalObject("devtoolsFrameworkInternalEventHandlers", object, "Getting framework internal event handlers failed: ")));
|
| + },
|
| +
|
| + /**
|
| + * @param {string} gettersName
|
| + * @param {!Object} argument
|
| + * @param {string} errorPrefix
|
| + * @return {!Array<*>}
|
| + */
|
| + _callCustomGettersOnGlobalObject: function(gettersName, argument, errorPrefix)
|
| + {
|
| + var getters = inspectedGlobalObject[gettersName];
|
| + if (!getters || !isArrayLike(getters))
|
| + return [];
|
| +
|
| + var results = [];
|
| + for (var i = 0; i < getters.length; ++i) {
|
| + try {
|
| + if (typeof getters[i] === "function")
|
| + results = concat(results, getters[i](argument));
|
| + } catch (e) {
|
| + this._logError(errorPrefix, e);
|
| + return [];
|
| + }
|
| + }
|
| + return results;
|
| }
|
| }
|
|
|
| @@ -1221,14 +1273,6 @@ InjectedScript.RemoteObject.prototype = {
|
| */
|
| _customPreview: function(object, objectGroupName, customObjectConfig)
|
| {
|
| - /**
|
| - * @param {!Error} error
|
| - */
|
| - function logError(error)
|
| - {
|
| - Promise.resolve().then(inspectedGlobalObject.console.error.bind(inspectedGlobalObject.console, "Custom Formatter Failed: " + error.message));
|
| - }
|
| -
|
| try {
|
| var formatters = inspectedGlobalObject["devtoolsFormatters"];
|
| if (!formatters || !isArrayLike(formatters))
|
| @@ -1248,11 +1292,11 @@ InjectedScript.RemoteObject.prototype = {
|
| result["configObjectId"] = injectedScript._bind(customObjectConfig, objectGroupName);
|
| return result;
|
| } catch (e) {
|
| - logError(e);
|
| + injectedScript._logError("Custom Formatter Failed: ", e);
|
| }
|
| }
|
| } catch (e) {
|
| - logError(e);
|
| + injectedScript._logError("Custom Formatter Failed: ", e);
|
| }
|
| return null;
|
| },
|
| @@ -1849,6 +1893,13 @@ CommandLineAPIImpl.prototype = {
|
| var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(node));
|
| if (!result)
|
| return result;
|
| +
|
| + var jQueryListeners = injectedScript.frameworkUserEventListeners(node);
|
| + for (var i = 0; i < jQueryListeners.length; ++i) {
|
| + result[jQueryListeners[i].type] = result[jQueryListeners[i].type] || [];
|
| + result[jQueryListeners[i].type].push(jQueryListeners[i]);
|
| + }
|
| +
|
| /** @this {{type: string, listener: function(), useCapture: boolean}} */
|
| var removeFunc = function()
|
| {
|
|
|