Windows - How to learn computer hard ware in online

Home Top Ad

Post Top Ad

Wednesday, January 17, 2018

Windows

Welcome to my “Windows”.

The current window refers to the window that contains the currently executing code. It is important to recognize that it can be different from the topmost or focused window.https://www.blogger.com

For example, suppose an extension creates a label or window from a single HTML file that contains a chrome.tabs.getSelected call. The current window refers to the window that contains the page that initiated the call, whether it is the topmost window or not.


In the example on the background page, the current window is the last active window. In some cases, the background page may not have the current window.

example
You can find some simple examples of using windows modules in the examples / app / windows directory. Another example is the checker example in the tabs_api.html file. For other examples and help with viewing the source code, see the examples.

API Reference: chrome.windows
Attributes
WINDOW_ID_NONE
chrome.windows.WINDOW_ID_NONE
WINDOW_ID_NONE (integer)
This windowId value means that there is no Chrome browser window.
method
create
chrome.windows.create (object createData, function callback)
Create (open) a new browser using any optional size, location, or URL provided by default.

parameter
createData (optional object optional)
URL (optional string or array of string optional, string or string array)
One or a group of URLs opened in the window as labels. The fully qualified URL must include a type (ie 'http://www.google.com', not 'www.google.com'). The relative URL will be related to the current page within the extension. The default is the new tab page.
tabId (optional integer optional, integer)
The id of the label you want to have selected in the new window.
left (optional integer optional, integer)
The pixel value of the new window relative to the left edge of the screen. If not specified, the new window is naturally offset from the last focused window.
top (optional integer, optional integer)
The pixel value of the new window relative to the top edge of the screen. If not specified, the new window is naturally offset from the last focused window.
width (optional integer, optional integer)
New window pixel width. If not specified, the default is the natural width.
height (optional integer, integer)
New window pixel height. If not specified, the default is the natural height.
incognito (optional boolean optional, Boolean type)
Is the new window incognito?
type (optional enumerated string ["normal", "popup"] Optional, enumerated string ["normal", "popup"])
Specify the type of new browser window.
callback (optional function optional)
Callback
If you specify a callback parameter, it should specify a function like this:

function (Window window) {...};
window (optional Window optional)
Contains the details of the newly created window.
get
chrome.windows.get (integer windowId, function callback)
Get detailed information about the window.

parameter
windowId (integer)
callback (function)
Callback function
If you specify a callback parameter, it should specify a function like this:

function (Window window) {...};
window (Window)
getAll
chrome.windows.getAll (object getInfo, function callback)
Get all the windows.

parameter
getInfo (optional object optional, object)
populate (optional boolean optional, Boolean type)
If true, each window object has a tabbed property that contains all the tabs for that window.
callback (function)
Callback
Callback parameters should specify a function as follows:

function (array of Window windows) {...};
windows (array of Window)
getCurrent
chrome.windows.getCurrent (function callback)
Get the current window.

parameter
callback (function)
Callback
If you specify a callback parameter, it should specify a function like this:

function (Window window) {...};
window (Window)
getLastFocused
chrome.windows.getLastFocused (function callback)
Get the most focused window - usually the top of the window.

parameter
callback (function)
Callback
If you specify a callback parameter, it should specify a function like this:

function (Window window) {...};
window (Window) 
remove
chrome.windows.remove (integer windowId, function callback)
Close a window and all the labels it contains.

parameter
windowId (integer)
callback (optional function optional)
Callback
If you specify a callback parameter, it should specify a function like this:

function () {...};
update
chrome.windows.update (integer windowId, object updateInfo, function callback)
Update the properties of a window. Only specify the attributes you want to modify, unspecified attributes will remain unchanged.

parameter
windowId (integer)
updateInfo (Object object)
left (optional integer optional, integer)
Pixel offset value that the window moves relative to the screen's left border.
top (optional integer, optional integer)
Pixel offset value that the window moves relative to the on-screen border.
width (optional integer, optional integer)
Window-width-adjusted pixel values.
height (optional integer, integer)
Window height-adjusted pixel values.
focused (optional boolean optional, Boolean type)
If true, bring the window to the front. Otherwise, bring the z-order up and down to the front.
callback (optional function optional)

function (Window window) {...};
window (Window)
event
onCreated
chrome.windows.onCreated.addListener (function (Window window) {...});
Fires when a new window is created.

parameter
window (Window)
The details of the form being created.
onFocusChanged
chrome.windows.onFocusChanged.addListener (function (integer windowId) {...});

Parameters
windowId (integer)
ID of the newly focused window.
onRemoved
chrome.windows.onRemoved.addListener (function (integer windowId) {...});
Fires when a window is closed.

parameter
windowId (integer)
The ID of the window to be closed.
Types of
Window
(object window, object)
id (integer)
An ID of the window. The window ID is unique within a browser session.
focused (boolean)
Whether the window is the current focus window.
top (integer)
Offset pixel value of the form relative to the top edge of the screen.
left (integer)
Offset pixel value of the form relative to the left edge of the screen.
width (integer)
Form width pixel value.
height (integer)
Form height pixel value.
tabs (optional array of Tab Optional, tag array)
Characterizes the array of labels contained in the form.
incognito (boolean)
Whether the form is hidden.
type (enumerated string ["normal", "popup", "app"])
Browser window type.

The development documentation for this page is translated by 360 engineers from the official Chromium extension development document, which you can freely spread and refer to.

No comments:

Post a Comment

Post Bottom Ad

Pages