Demo/bin/Debug/front_end/devtools.js
(开头部分) 20KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function(window) {
// DevToolsAPI ----------------------------------------------------------------
/**
* @constructor
*/
function DevToolsAPIImpl()
{
/**
* @type {number}
*/
this._lastCallId = 0;
/**
* @type {!Object.<number, function(?Object)>}
*/
this._callbacks = {};
}
DevToolsAPIImpl.prototype = {
/**
* @param {number} id
* @param {?Object} arg
*/
embedderMessageAck: function(id, arg)
{
var callback = this._callbacks[id];
delete this._callbacks[id];
if (callback)
callback(arg);
},
/**
* @param {string} method
* @param {!Array.<*>} args
* @param {?function(?Object)} callback
*/
sendMessageToEmbedder: function(method, args, callback)
{
var callId = ++this._lastCallId;
if (callback)
this._callbacks[callId] = callback;
var message = { "id": callId, "method": method };
if (args.length)
message.params = args;
DevToolsHost.sendMessageToEmbedder(JSON.stringify(message));
},
/**
* @param {string} method
* @param {!Array.<*>} args
*/
_dispatchOnInspectorFrontendAPI: function(method, args)
{
var api = window["InspectorFrontendAPI"];
后面还有 810 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。