home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / AvantBrowser / asetup.exe / _data / webkit / chrome.dll / 0 / BINDATA / 26526 < prev    next >
Encoding:
Text File  |  2013-04-03  |  16.7 KB  |  385 lines

  1. // Copyright (c) 2012 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": "extension",
  8.     "nocompile": true,
  9.     "dependencies": [ "events", "tabs" ],
  10.     "types": [
  11.       {
  12.         "id": "MessageSender",
  13.         "type": "object",
  14.         "description": "An object containing information about the script context that sent a message or request.",
  15.         "properties": {
  16.           "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This property will <b>only</b> be present when the connection was opened from a tab or content script."},
  17.           "id": {"type": "string", "description": "The extension ID of the extension that opened the connection."}
  18.         }
  19.       },
  20.       {
  21.         "id": "Port",
  22.         "type": "object",
  23.         "description": "An object which allows two way communication with other pages.",
  24.         "properties": {
  25.           "name": {"type": "string"},
  26.           "onDisconnect": { "$ref": "events.Event" },
  27.           "onMessage": { "$ref": "events.Event" },
  28.           "postMessage": {"type": "function"},
  29.           "sender": {
  30.             "$ref": "MessageSender",
  31.             "optional": true,
  32.             "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
  33.           }
  34.         },
  35.         "additionalProperties": { "type": "any"}
  36.       }
  37.     ],
  38.     "properties": {
  39.       "lastError": {
  40.         "type": "object",
  41.         "optional": true,
  42.         "unprivileged": true,
  43.         "description": "Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.",
  44.         "properties": {
  45.           "message": { "type": "string", "description": "Description of the error that has taken place." }
  46.         }
  47.       },
  48.       "inIncognitoContext": {
  49.         "type": "boolean",
  50.         "optional": true,
  51.         "unprivileged": true,
  52.         "description": "True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior."
  53.       }
  54.     },
  55.     "functions": [
  56.       {
  57.         "name": "connect",
  58.         "type": "function",
  59.         "unprivileged": true,
  60.         "description": "Attempts to connect to other listeners within the extension (such as the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $ref:tabs.connect.",
  61.         "parameters": [
  62.           {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
  63.           {
  64.             "type": "object",
  65.             "name": "connectInfo",
  66.             "properties": {
  67.               "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for extension processes that are listening for the connection event." }
  68.             },
  69.             "optional": true
  70.           }
  71.         ],
  72.         "returns": {
  73.           "$ref": "Port",
  74.           "description": "Port through which messages can be sent and received with the extension. The port's $ref:extension.Port event is fired if extension does not exist. "
  75.         }
  76.       },
  77.       {
  78.         "name": "connectNative",
  79.         "nodoc": true,
  80.         "type": "function",
  81.         "description": "Attempts to connect a native application in the host machine. The native application must have already registered itself in the proper directory.",
  82.         "parameters": [
  83.           {
  84.             "type": "string",
  85.             "name": "appName",
  86.             "description": "The name of the registered app to connect to."
  87.           },
  88.           {
  89.             "name": "connectionMessage",
  90.             "description": "The object that will be passed to the registered native app on connection.",
  91.             "type": "object",
  92.             "additionalProperties": {
  93.               "type": "any"
  94.             }
  95.           }
  96.         ],
  97.         "returns": {
  98.           "$ref": "Port",
  99.           "description": "Port through which messages can be sent and received with the application"
  100.         }
  101.       },
  102.       {
  103.         "name": "sendRequest",
  104.         "nodoc": true,
  105.         "type": "function",
  106.         "allowAmbiguousOptionalArguments": true,
  107.         "unprivileged": true,
  108.         "description": "Deprecated: Please use sendMessage.",
  109.         "parameters": [
  110.           {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
  111.           { "type": "any", "name": "request" },
  112.           {
  113.             "type": "function",
  114.             "name": "responseCallback",
  115.             "optional": true,
  116.             "parameters": [
  117.               {
  118.                 "name": "response",
  119.                 "type": "any",
  120.                 "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message."
  121.               }
  122.             ]
  123.           }
  124.         ]
  125.       },
  126.       {
  127.         "name": "sendMessage",
  128.         "type": "function",
  129.         "allowAmbiguousOptionalArguments": true,
  130.         "unprivileged": true,
  131.         "description": "Sends a single message to other listeners within the extension. Similar to chrome.extension.connect, but only sends a single message with an optional response. The $ref:extension.onMessage event is fired in each extension page of the extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $ref:tabs.sendMessage.",
  132.         "parameters": [
  133.           {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
  134.           { "type": "any", "name": "message" },
  135.           {
  136.             "type": "function",
  137.             "name": "responseCallback",
  138.             "optional": true,
  139.             "parameters": [
  140.               {
  141.                 "name": "response",
  142.                 "type": "any",
  143.                 "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message."
  144.               }
  145.             ]
  146.           }
  147.         ]
  148.       },
  149.       {
  150.         "name": "sendNativeMessage",
  151.         "nodoc": true,
  152.         "type": "function",
  153.         "description": "Send a single message to a registered native application.",
  154.         "parameters": [
  155.           {
  156.             "name": "registeredNativeApp",
  157.             "description": "The name of the registered native application.",
  158.             "type": "string"
  159.           },
  160.           {
  161.             "name": "message",
  162.             "description": "The message that will be passed to the registered native application.",
  163.             "type": "object",
  164.             "additionalProperties": {
  165.               "type": "any"
  166.             }
  167.           },
  168.           {
  169.             "type": "function",
  170.             "name": "callback",
  171.             "optional": true,
  172.             "description": "Called with the response from the native application.",
  173.             "parameters": [
  174.               {
  175.                 "name": "nativeResponse",
  176.                 "type": "object",
  177.                 "description": "Whatever the native application responds with.",
  178.                 "additionalProperties": {
  179.                   "type": "any"
  180.                 }
  181.               }
  182.             ]
  183.           }
  184.         ]
  185.       },
  186.       {
  187.         "name": "getURL",
  188.         "type": "function",
  189.         "unprivileged": true,
  190.         "description": "Converts a relative path within an extension install directory to a fully-qualified URL.",
  191.         "parameters": [
  192.           {
  193.             "type": "string",
  194.             "name": "path",
  195.             "description": "A path to a resource within an extension expressed relative to its install directory."
  196.           }
  197.         ],
  198.         "returns": {
  199.           "type": "string",
  200.           "description": "The fully-qualified URL to the resource."
  201.         }
  202.       },
  203.       {
  204.         "name": "getViews",
  205.         "type": "function",
  206.         "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.",
  207.         "parameters": [
  208.           {
  209.             "type": "object",
  210.             "name": "fetchProperties",
  211.             "optional": true,
  212.             "properties": {
  213.               "type": {
  214.                 "type": "string",
  215.                 "enum": ["tab", "infobar", "notification", "popup"],
  216.                 "optional": true,
  217.                 "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification', 'popup'."
  218.               },
  219.               "windowId": {
  220.                 "type": "integer",
  221.                 "optional": true,
  222.                 "description": "The window to restrict the search to. If omitted, returns all views."
  223.               }
  224.             }
  225.           }
  226.         ],
  227.         "returns": {
  228.           "type": "array",
  229.           "description": "Array of global objects",
  230.           "items": { "type": "object", "isInstanceOf": "global", "additionalProperties": { "type": "any" } }
  231.         }
  232.       },
  233.       {
  234.         "name": "getBackgroundPage",
  235.         "type": "function",
  236.         "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
  237.         "parameters": [],
  238.         "returns": {
  239.           "type": "object", "isInstanceOf": "global", "additionalProperties": { "type": "any" }
  240.          }
  241.       },
  242.       {
  243.         "name": "getExtensionTabs",
  244.         "nodoc": true,
  245.         "type": "function",
  246.         "maximumManifestVersion": 1,
  247.         "description": "Deprecated. Please use getViews({type: 'TAB'}). Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.",
  248.         "parameters": [
  249.           {"type": "integer", "name": "windowId", "optional": true}
  250.         ],
  251.         "returns": {
  252.           "type": "array",
  253.           "description": "Array of global window objects",
  254.           "items": { "type": "object", "isInstanceOf": "global", "additionalProperties": { "type": "any" } }
  255.         }
  256.       },
  257.       {
  258.         "name": "isAllowedIncognitoAccess",
  259.         "type": "function",
  260.         "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.",
  261.         "min_version": "12.0.706.0",
  262.         "parameters": [
  263.           {
  264.             "type": "function",
  265.             "name": "callback",
  266.             "parameters": [
  267.               {
  268.                 "name": "isAllowedAccess",
  269.                 "type": "boolean",
  270.                 "description": "True if the extension has access to Incognito mode, false otherwise."
  271.               }
  272.             ]
  273.           }
  274.         ]
  275.       },
  276.       {
  277.         "name": "isAllowedFileSchemeAccess",
  278.         "type": "function",
  279.         "description": "Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.",
  280.         "min_version": "12.0.706.0",
  281.         "parameters": [
  282.           {
  283.             "type": "function",
  284.             "name": "callback",
  285.             "parameters": [
  286.               {
  287.                 "name": "isAllowedAccess",
  288.                 "type": "boolean",
  289.                 "description": "True if the extension can access the 'file://' scheme, false otherwise."
  290.               }
  291.             ]
  292.           }
  293.         ]
  294.       },
  295.       {
  296.         "name": "setUpdateUrlData",
  297.         "type": "function",
  298.         "description": "Sets the value of the ap CGI parameter used in the extension's update URL.  This value is ignored for extensions that are hosted in the Chrome Extension Gallery.",
  299.         "parameters": [
  300.           {"type": "string", "name": "data", "maxLength": 1024}
  301.         ]
  302.       }
  303.     ],
  304.     "events": [
  305.       {
  306.         "name": "onConnect",
  307.         "type": "function",
  308.         "unprivileged": true,
  309.         "anonymous": true,
  310.         "description": "Fired when a connection is made from either an extension process or a content script.",
  311.         "parameters": [
  312.           {"$ref": "Port", "name": "port"}
  313.         ]
  314.       },
  315.       {
  316.         "name": "onConnectExternal",
  317.         "type": "function",
  318.         "anonymous": true,
  319.         "description": "Fired when a connection is made from another extension.",
  320.         "parameters": [
  321.           {"$ref": "Port", "name": "port"}
  322.         ]
  323.       },
  324.       {
  325.         "name": "onRequest",
  326.         "nodoc": true,
  327.         "type": "function",
  328.         "anonymous": true,
  329.         "unprivileged": true,
  330.         "description": "Deprecated: please use onMessage.",
  331.         "parameters": [
  332.           {"name": "request", "type": "any", "description": "The request sent by the calling script."},
  333.           {"name": "sender", "$ref": "MessageSender" },
  334.           {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one <code>onRequest</code> listener in the same document, then only one may send a response." }
  335.         ]
  336.       },
  337.       {
  338.         "name": "onRequestExternal",
  339.         "nodoc": true,
  340.         "type": "function",
  341.         "anonymous": true,
  342.         "description": "Deprecated: please use onMessageExternal.",
  343.         "parameters": [
  344.           {"name": "request", "type": "any", "description": "The request sent by the calling script."},
  345.           {"name": "sender", "$ref": "MessageSender" },
  346.           {"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
  347.         ]
  348.       },
  349.       {
  350.         "name": "onMessage",
  351.         "type": "function",
  352.         "anonymous": true,
  353.         "unprivileged": true,
  354.         "description": "Fired when a message is sent from either an extension process or a content script.",
  355.         "parameters": [
  356.           {"name": "message", "type": "any", "description": "The message sent by the calling script."},
  357.           {"name": "sender", "$ref": "MessageSender" },
  358.           {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one <code>onMessage</code> listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
  359.         ],
  360.         "returns": {
  361.           "type": "boolean",
  362.           "optional": "true",
  363.           "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
  364.         }
  365.       },
  366.       {
  367.         "name": "onMessageExternal",
  368.         "type": "function",
  369.         "anonymous": true,
  370.         "description": "Fired when a message is sent from another extension. Cannot be used in a content script.",
  371.         "parameters": [
  372.           {"name": "message", "type": "any", "description": "The message sent by the calling script."},
  373.           {"name": "sender", "$ref": "MessageSender" },
  374.           {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one <code>onMessage</code> listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
  375.         ],
  376.         "returns": {
  377.           "type": "boolean",
  378.           "optional": "true",
  379.           "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
  380.         }
  381.       }
  382.     ]
  383.   }
  384. ]
  385.