You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** The id of the tab for which you want to modify the page action. */
7504
7502
tabId: number;
7505
7503
/** The tooltip string. */
7506
7504
title: string;
7507
7505
}
7508
7506
7509
-
export interface GetDetails {
7510
-
/** Specify the tab to get the title from. */
7507
+
export interface TabDetails {
7508
+
/** The ID of the tab to query state for. */
7511
7509
tabId: number;
7512
7510
}
7513
7511
7514
7512
export interface PopupDetails {
7515
7513
/** The id of the tab for which you want to modify the page action. */
7516
7514
tabId: number;
7517
-
/** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
7515
+
/** The relative path to the HTML file to show in a popup. If set to the empty string (`''`), no popup is shown. */
7518
7516
popup: string;
7519
7517
}
7520
7518
7521
-
export interface IconDetails {
7522
-
/** The id of the tab for which you want to modify the page action. */
7523
-
tabId: number;
7524
-
/**
7525
-
* Optional.
7526
-
* @deprecated This argument is ignored.
7527
-
*/
7528
-
iconIndex?: number | undefined;
7529
-
/**
7530
-
* Optional.
7531
-
* Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
* Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
/** The id of the tab for which you want to modify the page action. */
7524
+
tabId: number;
7525
+
}
7526
+
& (
7527
+
| {
7528
+
/** Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */
/** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
/** Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */
/** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
7537
+
path: string | { [index: string]: string };
7538
+
}
7539
+
);
7540
7540
7541
7541
/**
7542
-
* Shows the page action. The page action is shown whenever the tab is selected.
7542
+
* Hides the page action. Hidden page actions still appear in the Chrome toolbar, but are grayed out.
7543
7543
* @param tabId The id of the tab for which you want to modify the page action.
7544
-
* @param callback Supported since Chrome 67
7544
+
* @param callback Since Chrome 67
7545
7545
*/
7546
7546
export function hide(tabId: number, callback?: () => void): void;
7547
+
7547
7548
/**
7548
7549
* Shows the page action. The page action is shown whenever the tab is selected.
7549
7550
* @param tabId The id of the tab for which you want to modify the page action.
7550
-
* @param callback Supported since Chrome 67
7551
+
* @param callback Since Chrome 67
7551
7552
*/
7552
7553
export function show(tabId: number, callback?: () => void): void;
7554
+
7553
7555
/**
7554
7556
* Sets the title of the page action. This is displayed in a tooltip over the page action.
7555
-
* @param callback Supported since Chrome 67
7557
+
* @param callback Since Chrome 67
7556
7558
*/
7557
7559
export function setTitle(details: TitleDetails, callback?: () => void): void;
7560
+
7558
7561
/**
7559
-
* Sets the html document to be opened as a popup when the user clicks on the page action's icon.
7560
-
* @param callback Supported since Chrome 67
7562
+
* Sets the HTML document to be opened as a popup when the user clicks on the page action's icon.
7563
+
* @param callback Since Chrome 67
7561
7564
*/
7562
7565
export function setPopup(details: PopupDetails, callback?: () => void): void;
7563
-
/**
7564
-
* Gets the title of the page action.
7565
-
* @since Chrome 19
7566
-
*/
7567
-
export function getTitle(details: GetDetails, callback: (result: string) => void): void;
7568
-
/**
7569
-
* Gets the html document set as the popup for this page action.
7570
-
* @since Chrome 19
7571
-
*/
7572
-
export function getPopup(details: GetDetails, callback: (result: string) => void): void;
7573
-
/**
7574
-
* Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
7575
-
*/
7566
+
7567
+
/** Gets the title of the page action. */
7568
+
export function getTitle(details: TabDetails, callback: (result: string) => void): void;
7569
+
7570
+
/** Gets the html document set as the popup for this page action. */
7571
+
export function getPopup(details: TabDetails, callback: (result: string) => void): void;
7572
+
7573
+
/** Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified. */
7576
7574
export function setIcon(details: IconDetails, callback?: () => void): void;
7577
7575
7578
7576
/** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */
0 commit comments