Skip to content

Commit

Permalink
Merge branch 'release/0.20.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lusito committed Sep 12, 2020
2 parents fe04dcb + c01b31a commit 807ed87
Show file tree
Hide file tree
Showing 15 changed files with 780 additions and 536 deletions.
24 changes: 24 additions & 0 deletions fixes/webRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@
"events.%onHeadersReceived.returns.$ref": "BlockingResponseOrPromise",
"events.%onAuthRequired.returns.$ref": "BlockingResponseOrPromise",
"events.%onAuthRequired.parameters.-[]": ["%callback"],
"events.%onErrorOccurred.extraParameters.+[]": [
{
"type": "array",
"optional": true,
"name": "extraInfoSpec",
"description": "Array of extra information that should be passed to the listener function.",
"items": {
"$ref": "OnErrorOccurredOptions"
}
}
],
"types.$OnBeforeRequestOptions.enum.+[]": ["extraHeaders"],
"types.$OnBeforeSendHeadersOptions.enum.+[]": ["extraHeaders"],
"types.$OnSendHeadersOptions.enum.+[]": ["extraHeaders"],
"types.$OnHeadersReceivedOptions.enum.+[]": ["extraHeaders"],
"types.$OnAuthRequiredOptions.enum.+[]": ["extraHeaders"],
"types.$OnResponseStartedOptions.enum.+[]": ["extraHeaders"],
"types.$OnBeforeRedirectOptions.enum.+[]": ["extraHeaders"],
"types.$OnCompletedOptions.enum.+[]": ["extraHeaders"],
"types.+[]": [
{
"id": "OnErrorOccurredOptions",
"type": "string",
"enum": ["extraHeaders"]
},
{
"type": "choices",
"id": "BlockingResponseOrPromise",
Expand Down
27 changes: 26 additions & 1 deletion lib/extensionTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export declare namespace ExtensionTypes {
type ImageFormat = "jpeg" | "png";

/**
* Details about the format and quality of an image.
* Details about the format, quality, area and scale of the capture.
*/
interface ImageDetails {

Expand All @@ -34,6 +34,18 @@ export declare namespace ExtensionTypes {
* Optional.
*/
quality?: number;

/**
* The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport.
* Optional.
*/
rect?: ImageDetailsRectType;

/**
* The scale of the resulting image. Defaults to <code>devicePixelRatio</code>.
* Optional.
*/
scale?: number;
}

/**
Expand Down Expand Up @@ -104,6 +116,19 @@ export declare namespace ExtensionTypes {
interface PlainJSONValue {
}

/**
* The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport.
*/
interface ImageDetailsRectType {
x: number;

y: number;

width: number;

height: number;
}

interface ExtensionFileOrCodeC1Type {
file: Manifest.ExtensionURL;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/geckoProfiler.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { Events } from "./events";

export declare namespace GeckoProfiler {
type ProfilerFeature = "java" | "js" | "leaf" | "mainthreadio" | "responsiveness" | "screenshots" | "seqstyle" | "stackwalk" | "tasktracer" | "threads" | "jstracer" | "jsallocations" | "nostacksampling" | "nativeallocations" | "preferencereads" | "ipcmessages" | "fileio" | "fileioall" | "noiostacks";
type ProfilerFeature = "java" | "js" | "leaf" | "mainthreadio" | "responsiveness" | "screenshots" | "seqstyle" | "stackwalk" | "tasktracer" | "threads" | "jstracer" | "jsallocations" | "nostacksampling" | "nativeallocations" | "preferencereads" | "ipcmessages" | "fileio" | "fileioall" | "noiostacks" | "audiocallbacktracing";

type supports = "windowLength";

Expand Down
8 changes: 6 additions & 2 deletions lib/manifest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export declare namespace Manifest {
/**
* Optional.
*/
background?: WebExtensionManifestBackgroundC1Type | WebExtensionManifestBackgroundC2Type;
background?: WebExtensionManifestBackgroundC1Type | WebExtensionManifestBackgroundC2Type | WebExtensionManifestBackgroundC3Type;

/**
* Optional.
Expand Down Expand Up @@ -509,6 +509,10 @@ export declare namespace Manifest {
persistent?: boolean;
}

interface WebExtensionManifestBackgroundC3Type {
service_worker: ExtensionURL;
}

interface WebExtensionManifestOptionsUiType {
page: ExtensionURL;

Expand Down Expand Up @@ -640,7 +644,7 @@ export declare namespace Manifest {
/**
* Optional.
*/
keyword?: string;
keyword?: string | string[];

search_url: string;

Expand Down
7 changes: 0 additions & 7 deletions lib/pkcs11.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* PKCS#11 module management API
* Permissions: "pkcs11"
*/
import { Types } from "./types";

export declare namespace Pkcs11 {
interface Token {

Expand Down Expand Up @@ -88,10 +86,5 @@ export declare namespace Pkcs11 {
* @returns Promise<undefined>
*/
getModuleSlots(name: string): Promise<undefined>;

/**
* Controls whether or not the built-in PKCS#11 module (osclientcerts) is loaded.
*/
autoload: Types.Setting;
}
}
4 changes: 2 additions & 2 deletions lib/tabs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ export declare namespace Tabs {
toggleReaderMode(tabId?: number): Promise<void>;

/**
* Captures the visible area of a specified tab. You must have $(topic:declare_permissions)[&lt;all_urls&gt;] permission to use this method.
* Captures an area of a specified tab. You must have $(topic:declare_permissions)[&lt;all_urls&gt;] permission to use this method.
*
* @param tabId Optional. The tab to capture. Defaults to the active tab of the current window.
* @param options Optional.
Expand All @@ -1130,7 +1130,7 @@ export declare namespace Tabs {
captureTab(tabId?: number, options?: ExtensionTypes.ImageDetails): Promise<string>;

/**
* Captures the visible area of the currently active tab in the specified window. You must have $(topic:declare_permissions)[&lt;all_urls&gt;] permission to use this method.
* Captures an area of the currently active tab in the specified window. You must have $(topic:declare_permissions)[&lt;all_urls&gt;] permission to use this method.
*
* @param windowId Optional. The target window. Defaults to the $(topic:current-window)[current window].
* @param options Optional.
Expand Down
21 changes: 12 additions & 9 deletions lib/webRequest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ import { Events } from "./events";
export declare namespace WebRequest {
type ResourceType = "main_frame" | "sub_frame" | "stylesheet" | "script" | "image" | "object" | "object_subrequest" | "xmlhttprequest" | "xslt" | "ping" | "beacon" | "xml_dtd" | "font" | "media" | "websocket" | "csp_report" | "imageset" | "web_manifest" | "speculative" | "other";

type OnBeforeRequestOptions = "blocking" | "requestBody";
type OnBeforeRequestOptions = "blocking" | "requestBody" | "extraHeaders";

type OnBeforeSendHeadersOptions = "requestHeaders" | "blocking";
type OnBeforeSendHeadersOptions = "requestHeaders" | "blocking" | "extraHeaders";

type OnSendHeadersOptions = "requestHeaders";
type OnSendHeadersOptions = "requestHeaders" | "extraHeaders";

type OnHeadersReceivedOptions = "blocking" | "responseHeaders";
type OnHeadersReceivedOptions = "blocking" | "responseHeaders" | "extraHeaders";

type OnAuthRequiredOptions = "responseHeaders" | "blocking" | "asyncBlocking";
type OnAuthRequiredOptions = "responseHeaders" | "blocking" | "asyncBlocking" | "extraHeaders";

type OnResponseStartedOptions = "responseHeaders";
type OnResponseStartedOptions = "responseHeaders" | "extraHeaders";

type OnBeforeRedirectOptions = "responseHeaders";
type OnBeforeRedirectOptions = "responseHeaders" | "extraHeaders";

type OnCompletedOptions = "responseHeaders";
type OnCompletedOptions = "responseHeaders" | "extraHeaders";

/**
* An object describing filters to apply to webRequest events.
Expand Down Expand Up @@ -271,6 +271,8 @@ export declare namespace WebRequest {
thirdParty: UrlClassificationParty;
}

type OnErrorOccurredOptions = "extraHeaders";

/**
* A BlockingResponse or a Promise<BlockingResponse>
*/
Expand Down Expand Up @@ -1464,8 +1466,9 @@ export declare namespace WebRequest {
*
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
* @param filter A set of filters that restricts the events that will be sent to this listener.
* @param extraInfoSpec Optional. Array of extra information that should be passed to the listener function.
*/
addListener(callback: (details: OnErrorOccurredDetailsType) => void, filter: RequestFilter): void;
addListener(callback: (details: OnErrorOccurredDetailsType) => void, filter: RequestFilter, extraInfoSpec?: OnErrorOccurredOptions[]): void;
}

interface Static {
Expand Down
Loading

0 comments on commit 807ed87

Please sign in to comment.