Skip to content

Commit 2ca2ee3

Browse files
committed
Merge pull request DefinitelyTyped#4502 from clicman/master
Add chrome.browser type
2 parents 7d790b1 + 47ccfe3 commit 2ca2ee3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

chrome/chrome.d.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@ declare module chrome.alarms {
4343
var onAlarm: AlarmEvent;
4444
}
4545

46+
/**
47+
* Use the chrome.browser API to interact with the Chrome browser associated with
48+
* the current application and Chrome profile.
49+
*/
50+
declare module chrome.browser {
51+
interface Options {
52+
/**
53+
* The URL to navigate to when the new tab is initially opened.
54+
*/
55+
url:string;
56+
}
57+
58+
/**
59+
* Opens a new tab in a browser window associated with the current application
60+
* and Chrome profile. If no browser window for the Chrome profile is opened,
61+
* a new one is opened prior to creating the new tab.
62+
* @param options Configures how the tab should be opened.
63+
* @param callback Called when the tab was successfully
64+
* created, or failed to be created. If failed, runtime.lastError will be set.
65+
*/
66+
export function openTab (options: Options, callback: () => void): void;
67+
68+
/**
69+
* Opens a new tab in a browser window associated with the current application
70+
* and Chrome profile. If no browser window for the Chrome profile is opened,
71+
* a new one is opened prior to creating the new tab. Since Chrome 42 only.
72+
* @param options Configures how the tab should be opened.
73+
*/
74+
export function openTab (options: Options): void;
75+
}
76+
4677
////////////////////
4778
// Bookmarks
4879
////////////////////

0 commit comments

Comments
 (0)