blob: 6d18dd5810c782e8d55fff2a07b404512af67f3e [file] [log] [blame]
// Copyright (c) 2012 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.
[
{
"namespace": "webNavigation",
"description": "Use the <code>chrome.webNavigation</code> API to receive notifications about the status of navigation requests in-flight.",
"types": [
{
"id": "TransitionType",
"type": "string",
"enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"],
"description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the <a href=\"history#transition_types\">history API</a> except with <code>\"start_page\"</code> in place of <code>\"auto_toplevel\"</code> (for backwards compatibility)."
},
{
"id": "TransitionQualifier",
"type": "string",
"enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]
}
],
"functions": [
{
"name": "getFrame",
"type": "function",
"description": "Retrieves information about the given frame. A frame refers to an &lt;iframe&gt; or a &lt;frame&gt; of a web page and is identified by a tab ID and a frame ID.",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Information about the frame to retrieve information about.",
"properties": {
"tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab in which the frame is." },
"processId": {
"type": "integer",
"optional": true,
"deprecated": "Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored.",
"description": "The ID of the process that runs the renderer for this tab."
},
"frameId": { "type": "integer", "minimum": 0, "description": "The ID of the frame in the given tab." }
}
},
{
"type": "function", "name": "callback", "parameters": [
{
"type": "object",
"name": "details",
"optional": true,
"description": "Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.",
"properties": {
"errorOccurred": {
"type": "boolean",
"description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
},
"url": {
"type": "string",
"description": "The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists."
},
"parentFrameId": {
"type": "integer",
"description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
}
}
}
]
}
]
},
{
"name": "getAllFrames",
"type": "function",
"description": "Retrieves information about all frames of a given tab.",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Information about the tab to retrieve all frames from.",
"properties": {
"tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab." }
}
},
{
"type": "function", "name": "callback", "parameters": [
{
"name": "details",
"type": "array",
"description": "A list of frames in the given tab, null if the specified tab ID is invalid.",
"optional": true,
"items": {
"type": "object",
"properties": {
"errorOccurred": {
"type": "boolean",
"description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
},
"processId": {
"type": "integer",
"description": "The ID of the process that runs the renderer for this frame."
},
"frameId": {
"type": "integer",
"description": "The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe."
},
"parentFrameId": {
"type": "integer",
"description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
},
"url": {
"type": "string",
"description": "The URL currently associated with this frame."
}
}
}
}
]
}
]
}
],
"events": [
{
"name": "onBeforeNavigate",
"type": "function",
"description": "Fired when a navigation is about to occur.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation is about to occur."},
"url": {"type": "string"},
"processId": {
"type": "integer",
"description": "The value of -1.",
"deprecated": "The processId is no longer set for this event, since the process which will render the resulting document is not known until onCommit."
},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process."},
"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."},
"timeStamp": {"type": "number", "description": "The time when the browser was about to start the navigation, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onCommitted",
"type": "function",
"description": "Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {"type": "integer", "description": "The ID of the process that runs the renderer for this frame."},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"transitionType": {"$ref": "TransitionType", "description": "Cause of the navigation."},
"transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
"timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onDOMContentLoaded",
"type": "function",
"description": "Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {"type": "integer", "description": "The ID of the process that runs the renderer for this frame."},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"timeStamp": {"type": "number", "description": "The time when the page's DOM was fully constructed, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onCompleted",
"type": "function",
"description": "Fired when a document, including the resources it refers to, is completely loaded and initialized.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {"type": "integer", "description": "The ID of the process that runs the renderer for this frame."},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"timeStamp": {"type": "number", "description": "The time when the document finished loading, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onErrorOccurred",
"type": "function",
"description": "Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {
"type": "integer",
"description": "The value of -1.",
"deprecated": "The processId is no longer set for this event."
},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"error": {"type": "string", "description": "The error description."},
"timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onCreatedNavigationTarget",
"type": "function",
"description": "Fired when a new window, or a new tab in an existing window, is created to host a navigation.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"sourceTabId": {"type": "integer", "description": "The ID of the tab in which the navigation is triggered."},
"sourceProcessId": {"type": "integer", "description": "The ID of the process that runs the renderer for the source frame."},
"sourceFrameId": {"type": "integer", "description": "The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame."},
"url": {"type": "string", "description": "The URL to be opened in the new window."},
"tabId": {"type": "integer", "description": "The ID of the tab in which the url is opened"},
"timeStamp": {"type": "number", "description": "The time when the browser was about to create a new view, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onReferenceFragmentUpdated",
"type": "function",
"description": "Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {"type": "integer", "description": "The ID of the process that runs the renderer for this frame."},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"transitionType": {"$ref": "TransitionType", "description": "Cause of the navigation."},
"transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
"timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onTabReplaced",
"type": "function",
"description": "Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"replacedTabId": {"type": "integer", "description": "The ID of the tab that was replaced."},
"tabId": {"type": "integer", "description": "The ID of the tab that replaced the old tab."},
"timeStamp": {"type": "number", "description": "The time when the replacement happened, in milliseconds since the epoch."}
}
}
]
},
{
"name": "onHistoryStateUpdated",
"type": "function",
"description": "Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.",
"filters": [
{
"name": "url",
"type": "array",
"items": { "$ref": "events.UrlFilter" },
"description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
}
],
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
"url": {"type": "string"},
"processId": {"type": "integer", "description": "The ID of the process that runs the renderer for this frame."},
"frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
"transitionType": {"$ref": "TransitionType", "description": "Cause of the navigation."},
"transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
"timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
}
}
]
}
]
}
]