Home | History | Annotate | Download | only in api
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 [
      6   {
      7     "namespace": "activityLogPrivate",
      8     "description": "none",
      9     "types": [
     10       {
     11         "id": "ExtensionActivity",
     12         "type": "object",
     13         "description": "This corresponds to a row from the ActivityLog database. Fields will be blank if they were specified precisely in a lookup filter.",
     14         "properties": {
     15           "extensionId": {"type": "string", "optional": true},
     16           "activityType": {"type": "string", "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request"]},
     17           "time": {"type": "number", "optional": true},
     18           "apiCall": {"type": "string", "optional": true},
     19           "args": {"type": "string", "optional": true},
     20           "count": {"type": "number", "optional": true},
     21           "pageUrl": {"type": "string", "optional": true},
     22           "pageTitle": {"type": "string", "optional": true},
     23           "argUrl": {"type": "string", "optional": true},
     24           "other": {
     25             "type": "object",
     26             "optional": true,
     27             "properties": {
     28               "prerender": {"type": "boolean", "optional": true},
     29               "domVerb": {"type": "string", "enum": ["getter", "setter", "method", "inserted", "xhr", "webrequest", "modified"], "optional": true},
     30               "webRequest": {"type": "string", "optional": true},
     31               "extra": {"type": "string", "optional": true}
     32             }
     33           }
     34         }
     35       },
     36       {
     37         "id": "Filter",
     38         "type": "object",
     39         "description": "Used to specify values for a lookup.",
     40         "properties": {
     41           "extensionId": {"type": "string", "optional": true, "description": "Exact match"},
     42           "activityType": {"type": "string", "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request", "any"], "description": "Exact match or any"},
     43           "apiCall": {"type": "string", "optional": true, "description": "Exact match"},
     44           "pageUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"},
     45           "argUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"},
     46           "daysAgo": {"type": "integer", "optional": true, "description": "Used to lookup a precise day; today is 0"}
     47         }
     48       },
     49       {
     50         "id": "ActivityResultSet",
     51         "type": "object",
     52         "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.",
     53         "properties": {
     54           "activities": {"type": "array", "items": {"$ref": "ExtensionActivity"}}
     55         }
     56       }
     57     ],
     58     "functions": [
     59       {
     60         "name": "getExtensionActivities",
     61         "type": "function",
     62         "description": "Retrieves activity from the ActivityLog that matches the specified filter.",
     63         "parameters": [
     64           {
     65             "name": "filter",
     66             "$ref": "Filter",
     67             "description": "Fill out the fields that you want to search for in the database."
     68           },
     69           {
     70             "name": "callback",
     71             "type": "function",
     72             "parameters": [
     73               {
     74                 "name": "result",
     75                 "$ref": "ActivityResultSet"
     76               }
     77             ]
     78           }
     79         ]
     80       },
     81       {
     82         "name": "deleteDatabase",
     83         "type": "function",
     84         "description": "Deletes the entire ActivityLog database.",
     85         "parameters": []
     86       },
     87       {
     88         "name": "deleteUrls",
     89         "type": "function",
     90         "description": "Delete URLs in the ActivityLog database.",
     91         "parameters": [
     92           {
     93             "name": "urls",
     94             "type": "array",
     95             "items": { "type": "string" },
     96             "description": "Erases only the URLs listed; if empty, erases all URLs.",
     97             "optional": true
     98           }
     99         ]
    100       }
    101     ],
    102     "events": [
    103       {
    104         "name": "onExtensionActivity",
    105         "type": "function",
    106         "description": "Fired when a given extension performs another activity.",
    107         "parameters": [
    108           {
    109             "name": "activity",
    110             "$ref": "ExtensionActivity"
    111           }
    112         ]
    113       }
    114     ]
    115   }
    116 ]
    117