| // Copyright 2013 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| [ |
| { |
| "namespace": "activityLogPrivate", |
| "description": "none", |
| "compiler_options": { |
| "modernised_enums": true |
| }, |
| "types": [ |
| { |
| "id": "ExtensionActivityType", |
| "type": "string", |
| "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request"] |
| }, |
| { |
| "id": "ExtensionActivityFilter", |
| "type": "string", |
| "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request", "any"], |
| "description": "Exact match or any" |
| }, |
| { |
| "id": "ExtensionActivityDomVerb", |
| "type": "string", |
| "enum": ["getter", "setter", "method", "inserted", "xhr", "webrequest", "modified"] |
| }, |
| { |
| "id": "ExtensionActivity", |
| "type": "object", |
| "description": "This corresponds to a row from the ActivityLog database. Fields will be blank if they were specified precisely in a lookup filter.", |
| "properties": { |
| "activityId": {"type": "string", "optional": true, "description": "An ID of a row in the ActivityLog database that corresponds to the activity. ID is set only on activities retrieved from the database."}, |
| "extensionId": {"type": "string", "optional": true}, |
| "activityType": {"$ref": "ExtensionActivityType"}, |
| "time": {"type": "number", "optional": true}, |
| "apiCall": {"type": "string", "optional": true}, |
| "args": {"type": "string", "optional": true}, |
| "count": {"type": "number", "optional": true}, |
| "pageUrl": {"type": "string", "optional": true}, |
| "pageTitle": {"type": "string", "optional": true}, |
| "argUrl": {"type": "string", "optional": true}, |
| "other": { |
| "type": "object", |
| "optional": true, |
| "properties": { |
| "prerender": {"type": "boolean", "optional": true}, |
| "domVerb": {"$ref": "ExtensionActivityDomVerb", "optional": true}, |
| "webRequest": {"type": "string", "optional": true}, |
| "extra": {"type": "string", "optional": true} |
| } |
| } |
| } |
| }, |
| { |
| "id": "Filter", |
| "type": "object", |
| "description": "Used to specify values for a lookup.", |
| "properties": { |
| "extensionId": {"type": "string", "optional": true, "description": "Exact match"}, |
| "activityType": {"$ref": "ExtensionActivityFilter"}, |
| "apiCall": {"type": "string", "optional": true, "description": "Exact match"}, |
| "pageUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"}, |
| "argUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"}, |
| "daysAgo": {"type": "integer", "optional": true, "description": "Used to lookup a precise day; today is 0"} |
| } |
| }, |
| { |
| "id": "ActivityResultSet", |
| "type": "object", |
| "description": "This holds the results of a lookup, the filter of the lookup, the time of the lookup, and whether there are more results that match.", |
| "properties": { |
| "activities": {"type": "array", "items": {"$ref": "ExtensionActivity"}} |
| } |
| } |
| ], |
| "functions": [ |
| { |
| "name": "getExtensionActivities", |
| "type": "function", |
| "description": "Retrieves activity from the ActivityLog that matches the specified filter.", |
| "parameters": [ |
| { |
| "name": "filter", |
| "$ref": "Filter", |
| "description": "Fill out the fields that you want to search for in the database." |
| } |
| ], |
| "returns_async": { |
| "name": "callback", |
| "parameters": [ |
| { |
| "name": "result", |
| "$ref": "ActivityResultSet" |
| } |
| ] |
| } |
| }, |
| { |
| "name": "deleteActivities", |
| "type": "function", |
| "description": "Deletes activities in the ActivityLog database specified in the array of activity IDs.", |
| "parameters": [ |
| { |
| "name": "activityIds", |
| "type": "array", |
| "items": { "type": "string" }, |
| "description": "Erases only the activities which IDs are listed in the array." |
| } |
| ], |
| "returns_async": { |
| "name": "callback", |
| "parameters": [], |
| "optional": true |
| } |
| }, |
| { |
| "name": "deleteActivitiesByExtension", |
| "type": "function", |
| "description": "Deletes activities in the ActivityLog database specified by the extension ID.", |
| "parameters": [ |
| { |
| "name": "extensionId", |
| "type": "string", |
| "description": "The ID of the extension to delete activities for." |
| } |
| ], |
| "returns_async": { |
| "name": "callback", |
| "parameters": [], |
| "optional": true |
| } |
| }, |
| { |
| "name": "deleteDatabase", |
| "type": "function", |
| "description": "Deletes the entire ActivityLog database.", |
| "parameters": [] |
| }, |
| { |
| "name": "deleteUrls", |
| "type": "function", |
| "description": "Delete URLs in the ActivityLog database.", |
| "parameters": [ |
| { |
| "name": "urls", |
| "type": "array", |
| "items": { "type": "string" }, |
| "description": "Erases only the URLs listed; if empty, erases all URLs." |
| } |
| ] |
| } |
| ], |
| "events": [ |
| { |
| "name": "onExtensionActivity", |
| "type": "function", |
| "description": "Fired when a given extension performs another activity.", |
| "parameters": [ |
| { |
| "name": "activity", |
| "$ref": "ExtensionActivity" |
| } |
| ] |
| } |
| ] |
| } |
| ] |