@ulixee/unblocked-specification
Advanced tools
Comparing version 2.0.0-alpha.18 to 2.0.0-alpha.19
@@ -7,6 +7,8 @@ import IDevtoolsSession from '../browser/IDevtoolsSession'; | ||
import IBrowserContext from '../browser/IBrowserContext'; | ||
import Protocol from 'devtools-protocol'; | ||
import TargetInfo = Protocol.Target.TargetInfo; | ||
export interface IBrowserContextHooks { | ||
onNewPage?(page: IPage): Promise<any>; | ||
onNewWorker?(worker: IWorker): Promise<any>; | ||
onDevtoolsPanelAttached?(devtoolsSession: IDevtoolsSession): Promise<any>; | ||
onDevtoolsPanelAttached?(devtoolsSession: IDevtoolsSession, targetInfo?: TargetInfo): Promise<any>; | ||
onDevtoolsPanelDetached?(devtoolsSession: IDevtoolsSession): Promise<any>; | ||
@@ -17,3 +19,3 @@ } | ||
onNewBrowserContext?(context: IBrowserContext): Promise<any>; | ||
onDevtoolsPanelAttached?(devtoolsSession: IDevtoolsSession): Promise<any>; | ||
onDevtoolsPanelAttached?(devtoolsSession: IDevtoolsSession, targetInfo?: TargetInfo): Promise<any>; | ||
} |
/// <reference types="node" /> | ||
import { URL } from 'url'; | ||
import IDnsSettings from "../net/IDnsSettings"; | ||
import ITcpSettings from "../net/ITcpSettings"; | ||
import IHttpSocketAgent from "../net/IHttpSocketAgent"; | ||
import IHttpResourceLoadDetails from "../net/IHttpResourceLoadDetails"; | ||
import IHttp2ConnectSettings from "../net/IHttp2ConnectSettings"; | ||
import ITlsSettings from "../net/ITlsSettings"; | ||
import IDnsSettings from '../net/IDnsSettings'; | ||
import ITcpSettings from '../net/ITcpSettings'; | ||
import IHttpSocketAgent from '../net/IHttpSocketAgent'; | ||
import IHttpResourceLoadDetails from '../net/IHttpResourceLoadDetails'; | ||
import IHttp2ConnectSettings from '../net/IHttp2ConnectSettings'; | ||
import ITlsSettings from '../net/ITlsSettings'; | ||
import IResourceType from '../net/IResourceType'; | ||
export default interface INetworkHooks { | ||
@@ -15,5 +16,7 @@ onDnsConfiguration?(settings: IDnsSettings): void; | ||
onHttp2SessionConnect?(request: IHttpResourceLoadDetails, settings: IHttp2ConnectSettings): Promise<any> | void; | ||
shouldBlockRequest?(url: string, resourceTypeIfKnown?: IResourceType): boolean; | ||
beforeHttpRequest?(request: IHttpResourceLoadDetails): Promise<any> | void; | ||
beforeHttpResponse?(resource: IHttpResourceLoadDetails): Promise<any> | void; | ||
afterHttpResponse?(resource: IHttpResourceLoadDetails): Promise<any> | void; | ||
websiteHasFirstPartyInteraction?(url: URL): Promise<any> | void; | ||
} |
@@ -42,2 +42,3 @@ /// <reference types="node" /> | ||
resourceType?: IResourceType; | ||
responseBodySize?: number; | ||
browserRequestId?: string; | ||
@@ -44,0 +45,0 @@ browserFrameId?: number; |
@@ -15,3 +15,4 @@ /// <reference types="node" /> | ||
statusMessage?: string; | ||
bodyBytes?: number; | ||
buffer?: Buffer; | ||
} |
@@ -6,2 +6,21 @@ # Change Log | ||
# [2.0.0-alpha.19](https://github.com/ulixee/unblocked/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2023-02-25) | ||
### Bug Fixes | ||
* **agent:** no autoattach when browser connects ([1ab573d](https://github.com/ulixee/unblocked/commit/1ab573df817226afdbd9f0b31c732ef171068604)) | ||
* **agent:** release memory leaks ([934dcdb](https://github.com/ulixee/unblocked/commit/934dcdba48bb0524f47e7ff60aca2fb4afdbd77a)) | ||
* **plugins:** avoid incognito detection ([8ced043](https://github.com/ulixee/unblocked/commit/8ced043473f44dd82961a7f96db9def797624e71)) | ||
### Features | ||
* **agent:** allow proxy local dns resolution ([#47](https://github.com/ulixee/unblocked/issues/47)) ([a9c412b](https://github.com/ulixee/unblocked/commit/a9c412b77bfc85d7d8634ade1ca647a40b3cc939)) | ||
* **plugins:** add shouldBlockRequest to spec ([ce826a5](https://github.com/ulixee/unblocked/commit/ce826a53133b2009c9572376d3507a0f17562513)) | ||
# [2.0.0-alpha.18](https://github.com/ulixee/unblocked/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2023-01-17) | ||
@@ -8,0 +27,0 @@ |
{ | ||
"name": "@ulixee/unblocked-specification", | ||
"version": "2.0.0-alpha.18", | ||
"version": "2.0.0-alpha.19", | ||
"description": "Interfaces to interact with Unblocked Agent Plugins", | ||
"homepage": "https://ulixee.org/unblocked", | ||
"repository": "git@github.com:ulixee/ulixee.git", | ||
"repository": "git@github.com:ulixee/unblocked.git", | ||
"bugs": { | ||
@@ -23,6 +23,6 @@ "url": "https://github.com/ulixee/unblocked/issues" | ||
"dependencies": { | ||
"@ulixee/js-path": "2.0.0-alpha.18", | ||
"@ulixee/js-path": "2.0.0-alpha.19", | ||
"devtools-protocol": "^0.0.981744" | ||
}, | ||
"gitHead": "500fb5eca0f26795933d8b377ffe7b654dee4cc0" | ||
"gitHead": "fc0add471c5f06fd53b6b889cb876c17cdbc6e61" | ||
} |
export default interface IDeviceProfile { | ||
deviceMemory?: number; | ||
deviceStorageTib?: number; | ||
maxHeapSize?: number; | ||
@@ -4,0 +5,0 @@ videoDevice?: { |
@@ -20,2 +20,3 @@ import type { IBoundLog } from '@ulixee/commons/interfaces/ILog'; | ||
upstreamProxyUrl?: string; | ||
upstreamProxyUseLocalDns?: boolean; | ||
upstreamProxyIpMask?: { | ||
@@ -33,2 +34,2 @@ publicIp?: string; | ||
} | ||
export declare type IEmulationOptions = IBrowserLaunchArgs & Pick<IEmulationProfile, 'viewport' | 'timezoneId' | 'locale' | 'upstreamProxyIpMask' | 'upstreamProxyUrl' | 'geolocation' | 'dnsOverTlsProvider'>; | ||
export declare type IEmulationOptions = IBrowserLaunchArgs & Pick<IEmulationProfile, 'viewport' | 'timezoneId' | 'locale' | 'upstreamProxyIpMask' | 'upstreamProxyUseLocalDns' | 'upstreamProxyUrl' | 'geolocation' | 'dnsOverTlsProvider'>; |
@@ -9,2 +9,3 @@ import { IHooksProvider } from '../agent/hooks/IHooks'; | ||
configure?(emulationProfile: IEmulationProfile<T>): void | Promise<void>; | ||
onClose?(): void; | ||
} | ||
@@ -11,0 +12,0 @@ export interface IUnblockedPluginClass<T = any> { |
@@ -51,4 +51,5 @@ # Unblocked Specification | ||
- positionY? `number`. Optional override browser Y position on screen in pixels (minimum 0, maximum 10000000). | ||
- upstreamProxyUrl `string`. A socks5 or http proxy url (and optional auth) to use for all HTTP requests in this session. The optional "auth" should be included in the UserInfo section of the url, eg: `http://username:password@proxy.com:80`. | ||
- upstreamProxyIpMask `object`. Optional settings to mask the Public IP Address of a host machine when using a proxy. This is used by the default BrowserEmulator to mask WebRTC IPs. | ||
- upstreamProxyUrl `string`. A socks5 or http proxy url (and optional auth) to use for all HTTP requests in this session. The optional "auth" should be included in the UserInfo section of the url, eg: `http://username:password@proxy.com:80`. | ||
- upstreamProxyUseSystemDns `boolean`. A variable to indicate DNS should be resolved on the host machine. By default, if a proxy is used, hosts will be resolved by the remote proxy. | ||
- upstreamProxyIpMask `object`. Optional settings to mask the Public IP Address of a host machine when using a proxy. This is used by the default BrowserEmulator to mask WebRTC IPs. | ||
- ipLookupService `string`. The URL of an http based IpLookupService. | ||
@@ -153,3 +154,3 @@ - proxyIp `string`. The optional IP address of your proxy, if known ahead of time. | ||
Add a custom DOM override to the plugin. The function will be run only by the first Plugin that returns true. | ||
Add a custom DOM override to the plugin. The function will be run only by the first Plugin that returns `true`. | ||
@@ -299,5 +300,12 @@ - _runOn_ `page | worker` Where to run this script. | ||
#### shouldBlockRequest(url, resourceTypeIfKnown?) | ||
Callback before each an HTTP request is initiated. Any plugin returning `true` will halt processing for the given request. | ||
- url: `string`. The url being requested. | ||
- resourceTypeIfKnown: [`IResourceType`](./agent/net/IResourceType.ts). The type of resource being requested if it can be determined by the browser. | ||
#### beforeHttpRequest(request) | ||
Callback before each HTTP request. This hook provides the opportunity to manipulate or bypass each request before it's sent on to the destination URL. | ||
Callback before each HTTP request (after a socket has been established and protocol agreed upon, but before sending any HTTP request). This hook provides the opportunity to manipulate each request before it's sent on to the destination URL. | ||
@@ -320,2 +328,7 @@ Browsers and versions send specific HTTP header values and order that are consistent by Resource Type, Origin, Cookie status, and more. An emulator should ensure headers are correct before a request is sent. | ||
#### afterHttpResponse(resource) | ||
Callback after an HTTP response was already sent to the browser. This can be used to keep track of the incoming resources without it blocking | ||
the processing of the response. As it is called after the entire process it also allows us to track the response body. | ||
#### websiteHasFirstPartyInteraction(url) | ||
@@ -322,0 +335,0 @@ |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
105823
1867
337
+ Added@ulixee/js-path@2.0.0-alpha.19(transitive)
- Removed@ulixee/js-path@2.0.0-alpha.18(transitive)