mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Add optional filters to webNavigation events
There is an additional argument according to https://developer.chrome.com/extensions/webNavigation Filters argument is not well documented but present. Sample from Google: https://developer.chrome.com/extensions/examples/extensions/gmail/background.js
This commit is contained in:
22
chrome/chrome.d.ts
vendored
22
chrome/chrome.d.ts
vendored
@@ -140,7 +140,7 @@ declare module chrome.browserAction {
|
||||
|
||||
interface TitleDetails {
|
||||
title: string;
|
||||
tabId?: number;
|
||||
tabId?: number;WebNavigationReferenceFragmentUpdatedEvent
|
||||
}
|
||||
|
||||
interface TabDetails {
|
||||
@@ -2173,20 +2173,24 @@ declare module chrome.webNavigation {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface WebNavigationEventFilters {
|
||||
url: chrome.events.UrlFilter[];
|
||||
}
|
||||
|
||||
interface WebNavigationReferenceFragmentUpdatedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void): void;
|
||||
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void, filters? : WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCompletedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CompletedDetails) => void): void;
|
||||
addListener(callback: (details: CompletedDetails) => void, filters? : WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationHistoryStateUpdatedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: HistoryStateUpdatedDetails) => void): void;
|
||||
addListener(callback: (details: HistoryStateUpdatedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCreatedNavigationTargetEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CreatedNavigationTargetDetails) => void): void;
|
||||
addListener(callback: (details: CreatedNavigationTargetDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationTabReplacedEvent extends chrome.events.Event {
|
||||
@@ -2194,19 +2198,19 @@ declare module chrome.webNavigation {
|
||||
}
|
||||
|
||||
interface WebNavigationBeforeNavigateEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: BeforeNavigateDetails) => void): void;
|
||||
addListener(callback: (details: BeforeNavigateDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCommittedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CommittedDetails) => void): void;
|
||||
addListener(callback: (details: CommittedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationDomContentLoadedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: DomContentLoadedDetails) => void): void;
|
||||
addListener(callback: (details: DomContentLoadedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationErrorOccurredEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: ErrorOccurredDetails) => void): void;
|
||||
addListener(callback: (details: ErrorOccurredDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
export function getFrame(details: GetFrameDetails, callback: (details?: GetFrameResultDetails) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user