Chromium 中chrome.webRequest扩展接口定义c++

一、chrome.webRequest

注意:从 Manifest V3 开始,"webRequestBlocking"权限不再适用于大多数扩展程序。以"declarativeNetRequest"为例,它允许使用declarativeNetRequest API。除了"webRequestBlocking"之外,webRequest API 保持不变,仍可正常使用。通过政策安装的扩展程序可以继续使用"webRequestBlocking"

使用chrome.webRequestAPI 可观察和分析流量,以及拦截、阻止或修改传输中的请求。

权限

webRequest

您必须在扩展程序清单中声明"webRequest"权限,才能使用 Web 请求 API 以及必要的主机权限。要拦截子资源请求, 扩展程序必须同时有权访问请求的网址及其发起者。例如:

{"name": "My extension",..."permissions": ["webRequest"],"host_permissions": ["*://*.google.com/*"],...
}

webRequestBlocking

必须填写此字段,才能注册屏蔽事件处理脚本。从 Manifest V3 开始, 适用于通过政策安装的扩展程序

webRequestAuthProvider

使用onAuthRequired方法的必需条件。请参阅处理身份验证。

请求的生命周期

Web 请求 API 定义了一组遵循 Web 请求生命周期的事件。您可以使用 来观察和分析流量。某些同步事件允许您拦截、 屏蔽或修改请求

成功请求的事件生命周期如下所示,其后是事件定义:

从 webrequest API 的角度看网络请求的生命周期

更多参考chrome.webRequest ?|? API ?|? Chrome for Developers

二、chrome.webRequest c++接口定义:

1、web_request.json接口描述文件:

extensionscommonapiweb_request.json

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.[{"namespace": "webRequest","description": "Use the <code>chrome.webRequest</code> API to observe and analyze traffic and to intercept, block, or modify requests in-flight.","properties": {"MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": {"value": 20,"description": "The maximum number of times that <code>handlerBehaviorChanged</code> can be called per 10 minute sustained interval. <code>handlerBehaviorChanged</code> is an expensive function call that shouldn't be called often."}},"types": [{"id": "ResourceType","type": "string","enum": [{"name": "main_frame", "description": "Specifies the resource as the main frame."},{"name": "sub_frame", "description": "Specifies the resource as a sub frame."},{"name":  "stylesheet", "description": "Specifies the resource as a stylesheet."},{"name": "script", "description": "Specifies the resource as a script."},{"name": "image", "description": "Specifies the resource as an image."},{"name": "font", "description": "Specifies the resource as a font."},{"name": "object", "description": "Specifies the resource as an object."},{"name": "xmlhttprequest","description": "Specifies the resource as an XMLHttpRequest."},{"name": "ping","description": "Specifies the resource as a ping."},{"name": "csp_report","description": "Specifies the resource as a Content Security Policy (CSP) report."},{"name": "media", "description": "Specifies the resource as a media object."},{"name": "websocket", "description": "Specifies the resource as a WebSocket."},{"name": "webbundle", "description": "Specifies the resource as a WebBundle."},{"name": "other", "description": "Specifies the resource as a type not included in the listed types."}]},{"id": "OnBeforeRequestOptions","type": "string","enum": [{"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},{"name": "requestBody", "description": "Specifies that the request body should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnBeforeSendHeadersOptions","type": "string","enum": [{"name": "requestHeaders", "description": "Specifies that the request header should be included in the event."},{"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnSendHeadersOptions","type": "string","enum": [{"name": "requestHeaders", "description": "Specifies that the request header should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnHeadersReceivedOptions","type": "string","enum": [{"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},{"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnAuthRequiredOptions","type": "string","enum": [{"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},{"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},{"name": "asyncBlocking", "description": "Specifies that the callback function is handled asynchronously."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnResponseStartedOptions","type": "string","enum": [{"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnBeforeRedirectOptions","type": "string","enum": [{"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnCompletedOptions","type": "string","enum": [{"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "OnErrorOccurredOptions","type": "string","enum": [{"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}]},{"id": "RequestFilter","type": "object","description": "An object describing filters to apply to webRequest events.","properties": {"urls": {"type": "array","description": "A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out.","items": { "type": "string" }},"types": {"type": "array","optional": true,"description": "A list of request types. Requests that cannot match any of the types will be filtered out.","items": { "$ref": "ResourceType" }},"tabId": { "type": "integer", "optional": true },"windowId": { "type": "integer", "optional": true }}},{"id": "HttpHeaders","nocompile": true,"type": "array","description": "An array of HTTP headers. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>.","items": {"type": "object","properties": {"name": {"type": "string", "description": "Name of the HTTP header."},"value": {"type": "string", "optional": true, "description": "Value of the HTTP header if it can be represented by UTF-8."},"binaryValue": {"type": "array","optional": true,"description": "Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255).","items": {"type": "integer"}}}}},{"id": "BlockingResponse","nocompile": true,"type": "object","description": "Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests.","properties": {"cancel": {"type": "boolean","optional": true,"description": "If true, the request is cancelled. This prevents the request from being sent. This can be used as a response to the onBeforeRequest, onBeforeSendHeaders, onHeadersReceived and onAuthRequired events."},"redirectUrl": {"type": "string","optional": true,"description": "Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as <code>data:</code> are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method. Redirects from URLs with <code>ws://</code> and <code>wss://</code> schemes are <b>ignored</b>."},"requestHeaders": {"$ref": "HttpHeaders","optional": true,"description": "Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead."},"responseHeaders": {"$ref": "HttpHeaders","optional": true,"description": "Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return <code>responseHeaders</code> if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify <code>responseHeaders</code> for each request)."},"authCredentials": {"type": "object","description": "Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.","optional": true,"properties": {"username": {"type": "string"},"password": {"type": "string"}}}}},{"id": "UploadData","type": "object","properties": {"bytes": {"type": "any","optional": true,"description": "An ArrayBuffer with a copy of the data."},"file": {"type": "string","optional": true,"description": "A string with the file's path and name."}},"description": "Contains data uploaded in a URL request."},{"id": "FormDataItem","choices": [{ "type": "binary" },{ "type": "string" }],"description": "Contains data passed within form data. For urlencoded form it is stored as string if data is utf-8 string and as ArrayBuffer otherwise. For form-data it is ArrayBuffer. If form-data represents uploading file, it is string with filename, if the filename is provided."},{"id": "IgnoredActionType","decription": "Denotes the extension proposed action which was ignored.","type": "string","enum": ["redirect", "request_headers", "response_headers", "auth_credentials"]}],"functions": [{"name": "handlerBehaviorChanged","type": "function","description": "Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often.","parameters": [],"returns_async": {"name": "callback", "optional": true, "parameters": []}}],"events": [{"name": "onBeforeRequest","type": "function","description": "Fired when a request is about to occur.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "optional": true, "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "optional": true, "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "optional": true, "description": "The type of frame the request occurred in."},"requestBody": {"type": "object","optional": true,"description": "Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'.","properties": {"error": {"type": "string", "optional": true, "description": "Errors when obtaining request body data."},"formData": {"type": "object","optional": true,"description": "If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.","properties": {},"additionalProperties": {"type": "array","items": { "$ref": "FormDataItem" }}},"raw" : {"type": "array","optional": true,"items": {"$ref": "UploadData"},"description": "If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array."}}},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnBeforeRequestOptions"}}],"returns": {"$ref": "BlockingResponse","description": "If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.","optional": true}},{"name": "onBeforeSendHeaders","nocompile": true,"type": "function","description": "Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. ","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that are going to be sent out with this request."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnBeforeSendHeadersOptions"}}],"returns": {"$ref": "BlockingResponse","description": "If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.","optional": true}},{"name": "onSendHeaders","nocompile": true,"type": "function","description": "Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired).","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that have been sent out with this request."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnSendHeadersOptions"}}]},{"name": "onHeadersReceived","nocompile": true,"type": "function","description": "Fired when HTTP response headers of a request have been received.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line)."},"responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that have been received with this response."},"statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnHeadersReceivedOptions"}}],"returns": {"$ref": "BlockingResponse","description": "If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.","optional": true}},{"name": "onAuthRequired","nocompile": true,"type": "function","description": "Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request. Note, only one of <code>'blocking'</code> or <code>'asyncBlocking'</code> modes must be specified in the <code>extraInfoSpec</code> parameter.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"scheme": {"type": "string", "description": "The authentication scheme, e.g. Basic or Digest."},"realm": {"type": "string", "description": "The authentication realm provided by the server, if there is one.", "optional": true},"challenger": {"type": "object", "description": "The server requesting authentication.", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}}},"isProxy": {"type": "boolean", "description": "True for Proxy-Authenticate, false for WWW-Authenticate."},"responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},"statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},"statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}}},{"type": "function","optional": true,"description" : "Only valid if <code>'asyncBlocking'</code> is specified as one of the <code>OnAuthRequiredOptions</code>.","name": "asyncCallback","parameters": [{"name": "response", "$ref": "BlockingResponse"}]}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnAuthRequiredOptions"}}],"returns": {"$ref": "BlockingResponse","description": "If "blocking" is specified in the "extraInfoSpec" parameter, the event listener should return an object of this type.","optional": true}},{"name": "onResponseStarted","nocompile": true,"type": "function","description": "Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},"fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},"statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},"responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},"statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnResponseStartedOptions"}}]},{"name": "onBeforeRedirect","type": "function","nocompile": true,"description": "Fired when a server-initiated redirect is about to occur.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},"fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},"statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},"redirectUrl": {"type": "string", "description": "The new URL."},"responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this redirect."},"statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnBeforeRedirectOptions"}}]},{"name": "onCompleted","type": "function","nocompile": true,"description": "Fired when a request is completed.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},"fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},"statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},"responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},"statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnCompletedOptions"}}]},{"name": "onErrorOccurred","type": "function","description": "Fired when an error occurs.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"url": {"type": "string"},"method": {"type": "string", "description": "Standard HTTP method."},"frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},"parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},"documentId": {"type": "string", "description": "The UUID of the document making the request. This value is not present if the request is a navigation of a frame."},"parentDocumentId": {"type": "string", "optional": true, "description": "The UUID of the parent document owning this frame. This is not set if there is no parent."},"documentLifecycle": {"$ref": "extensionTypes.DocumentLifecycle", "description": "The lifecycle the document is in."},"frameType": {"$ref": "extensionTypes.FrameType", "description": "The type of frame the request occurred in."},"tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},"type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},"initiator": {"type": "string", "optional": true, "description": "The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used."},"timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},"ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},"fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},"error": {"type": "string", "description": "The error description. This string is <em>not</em> guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content."}}}],"extraParameters": [{"$ref": "RequestFilter","name": "filter","description": "A set of filters that restricts the events that will be sent to this listener."},{"type": "array","optional": true,"name": "extraInfoSpec","description": "Array of extra information that should be passed to the listener function.","items": {"$ref": "OnErrorOccurredOptions"}}]},{"name": "onActionIgnored","type": "function","description": "Fired when an extension's proposed modification to a network request is ignored. This happens in case of conflicts with other extensions.","parameters": [{"type": "object","name": "details","properties": {"requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},"action": {"$ref": "IgnoredActionType", "description": "The proposed action which was ignored."}}}]}]}
]

2、web_request.json生成的c++文件:

outDebuggenextensionscommonapiweb_request.h

outDebuggenextensionscommonapiweb_request.cc

3、web_request api接口定义c++:

extensionsrowserapiweb_requestweb_request_api.h

extensionsrowserapiweb_requestweb_request_api.cc

namespace extensions {// Support class for the WebRequest API. Lives on the UI thread. Most of the
// work is done by ExtensionWebRequestEventRouter below. This class observes
// extensions::EventRouter to deal with event listeners. There is one instance
// per BrowserContext which is shared with incognito.
class WebRequestAPI : public BrowserContextKeyedAPI,public EventRouter::Observer,public ExtensionRegistryObserver {public:// A callback used to asynchronously respond to an intercepted authentication// request. If |should_cancel| is true the request will be cancelled.// Otherwise any supplied |credentials| will be used. If no credentials are// supplied, default browser behavior will follow (e.g. UI prompt for login).using AuthRequestCallback = base::OnceCallback<void(const std::optional<net::AuthCredentials>& credentials,bool should_cancel)>;// An interface which is held by ProxySet defined below.class Proxy {public:virtual ~Proxy() = default;// Asks the Proxy to handle an auth request on behalf of one of its known// in-progress network requests. If the request will *not* be handled by// the proxy, |callback| should be invoked with |std::nullopt|.virtual void HandleAuthRequest(const net::AuthChallengeInfo& auth_info,scoped_refptr<net::HttpResponseHeaders> response_headers,int32_t request_id,AuthRequestCallback callback);};// A ProxySet is a set of proxies used by WebRequestAPI: It holds Proxy// instances, and removes all proxies when it is destroyed.class ProxySet {public:ProxySet();ProxySet(const ProxySet&) = delete;ProxySet& operator=(const ProxySet&) = delete;~ProxySet();// Add a Proxy.void AddProxy(std::unique_ptr<Proxy> proxy);// Remove a Proxy. The removed proxy is deleted upon this call.void RemoveProxy(Proxy* proxy);// Associates |proxy| with |id|. |proxy| must already be registered within// this ProxySet.//// Each Proxy may be responsible for multiple requests, but any given// request identified by |id| must be associated with only a single proxy.void AssociateProxyWithRequestId(Proxy* proxy,const content::GlobalRequestID& id);// Disassociates |proxy| with |id|. |proxy| must already be registered// within this ProxySet.void DisassociateProxyWithRequestId(Proxy* proxy,const content::GlobalRequestID& id);Proxy* GetProxyFromRequestId(const content::GlobalRequestID& id);void MaybeProxyAuthRequest(const net::AuthChallengeInfo& auth_info,scoped_refptr<net::HttpResponseHeaders> response_headers,const content::GlobalRequestID& request_id,AuthRequestCallback callback);private:// Although these members are initialized on the UI thread, we expect at// least one memory barrier before actually calling Generate in the IO// thread, so we don't protect them with a lock.std::set<std::unique_ptr<Proxy>, base::UniquePtrComparator> proxies_;// Bi-directional mapping between request ID and Proxy for faster lookup.std::map<content::GlobalRequestID, Proxy*> request_id_to_proxy_map_;std::map<Proxy*, std::set<content::GlobalRequestID>>proxy_to_request_id_map_;};class RequestIDGenerator {public:RequestIDGenerator();RequestIDGenerator(const RequestIDGenerator&) = delete;RequestIDGenerator& operator=(const RequestIDGenerator&) = delete;~RequestIDGenerator();// Generates a WebRequest ID. If the same (routing_id,// network_service_request_id) pair is passed to this as was previously// passed to SaveID(), the |request_id| passed to SaveID() will be returned.int64_t Generate(int32_t routing_id, int32_t network_service_request_id);// This saves a WebRequest ID mapped to the (routing_id,// network_service_request_id) pair. Clients must call Generate() with the// same ID pair to retrieve the |request_id|, or else there may be a memory// leak.void SaveID(int32_t routing_id,int32_t network_service_request_id,uint64_t request_id);private:int64_t id_ = 0;std::map<std::pair<int32_t, int32_t>, uint64_t> saved_id_map_;};explicit WebRequestAPI(content::BrowserContext* context);WebRequestAPI(const WebRequestAPI&) = delete;WebRequestAPI& operator=(const WebRequestAPI&) = delete;~WebRequestAPI() override;// BrowserContextKeyedAPI support:static BrowserContextKeyedAPIFactory<WebRequestAPI>* GetFactoryInstance();void Shutdown() override;// EventRouter::Observer overrides:void OnListenerRemoved(const EventListenerInfo& details) override;// If any WebRequest event listeners are currently active for this// BrowserContext, |*factory_request| is swapped out for a new request which// proxies through an internal URLLoaderFactory. This supports lifetime// observation and control on behalf of the WebRequest API.// |frame| and |render_process_id| are the frame and render process id in// which the URLLoaderFactory will be used. |frame| can be nullptr for// factories proxied for service worker.//// |navigation_response_task_runner| is a task runner that may be non-null for// navigation requests and can be used to run navigation request blocking// tasks.//// Returns |true| if the URLLoaderFactory will be proxied; |false| otherwise.bool MaybeProxyURLLoaderFactory(content::BrowserContext* browser_context,content::RenderFrameHost* frame,int render_process_id,content::ContentBrowserClient::URLLoaderFactoryType type,std::optional<int64_t> navigation_id,ukm::SourceIdObj ukm_source_id,mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*header_client,scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner,const url::Origin& request_initiator = url::Origin());// Any request which requires authentication to complete will be bounced// through this method.//// If this returns |true|, |callback| will eventually be invoked on the UI// thread.bool MaybeProxyAuthRequest(content::BrowserContext* browser_context,const net::AuthChallengeInfo& auth_info,scoped_refptr<net::HttpResponseHeaders> response_headers,const content::GlobalRequestID& request_id,bool is_main_frame,AuthRequestCallback callback,WebViewGuest* web_view_guest);// Starts proxying the connection with |factory|. This function can be called// only when MayHaveProxies() returns true.void ProxyWebSocket(content::RenderFrameHost* frame,content::ContentBrowserClient::WebSocketFactory factory,const GURL& url,const net::SiteForCookies& site_for_cookies,const std::optional<std::string>& user_agent,mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>handshake_client);// Starts proxying WebTransport handshake.void ProxyWebTransport(content::RenderProcessHost& render_process_host,int frame_routing_id,const GURL& url,const url::Origin& initiator_origin,mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>handshake_client,content::ContentBrowserClient::WillCreateWebTransportCallback callback);void ForceProxyForTesting();// Indicates whether or not the WebRequestAPI may have one or more proxies// installed to support the API.bool MayHaveProxies() const;// Indicates whether or not WebRequestAPI may have one or more proxies// installed to support intercepting websocket connections for extension// telemetry.// TODO(psarouthakis): This is here for the current implementation, but// will be refactored to live somewhere else so that we don't have to// create a full proxy just for telemetry.bool MayHaveWebsocketProxiesForExtensionTelemetry() const;// Indicates whether the WebRequestAPI is available to a RenderFrameHost// that embeds a WebView instance.bool IsAvailableToWebViewEmbedderFrame(content::RenderFrameHost* render_frame_host) const;bool HasExtraHeadersListenerForTesting();private:friend class BrowserContextKeyedAPIFactory<WebRequestAPI>;// BrowserContextKeyedAPI support:static const char* service_name() { return "WebRequestAPI"; }static const bool kServiceRedirectedInIncognito = true;static const bool kServiceIsNULLWhileTesting = true;// Checks if |MayHaveProxies()| has changed from false to true, and resets// URLLoaderFactories if so.void UpdateMayHaveProxies();// ExtensionRegistryObserver implementation.void OnExtensionLoaded(content::BrowserContext* browser_context,const Extension* extension) override;void OnExtensionUnloaded(content::BrowserContext* browser_context,const Extension* extension,UnloadedExtensionReason reason) override;// This a proxy API for the tasks that are posted. It is either called// when the task is run and forwards to the corresponding member function// in ExtensionWebRequestEventRouter, or not, if the owning BrowserContext// goes away or the WeakPtr instance bound in the callback is invalidated.void UpdateActiveListener(content::BrowserContext* browser_context,WebRequestEventRouter::ListenerUpdateType update_type,const ExtensionId& extension_id,const std::string& sub_event_name,int worker_thread_id,int64_t service_worker_version_id);// This a proxy API for the tasks that are posted. It is either called// when the task is run and forwards to the corresponding member function// in ExtensionWebRequestEventRouter, or not, if the owning BrowserContext// goes away or the WeakPtr instance bound in the callback is invalidated.void RemoveLazyListener(content::BrowserContext* browser_context,const ExtensionId& extension_id,const std::string& sub_event_name);// A count of active extensions for this BrowserContext that use web request// permissions.int web_request_extension_count_ = 0;const raw_ptr<content::BrowserContext, DanglingUntriaged> browser_context_;RequestIDGenerator request_id_generator_;std::unique_ptr<ProxySet> proxies_;// Stores the last result of |MayHaveProxies()|, so it can be used in// |UpdateMayHaveProxies()|.bool may_have_proxies_;base::WeakPtrFactory<WebRequestAPI> weak_factory_{this};
};class WebRequestInternalFunction : public ExtensionFunction {public:WebRequestInternalFunction() = default;protected:~WebRequestInternalFunction() override = default;const std::string& extension_id_safe() const {return extension() ? extension_id() : base::EmptyString();}
};class WebRequestInternalAddEventListenerFunction: public WebRequestInternalFunction {public:DECLARE_EXTENSION_FUNCTION("webRequestInternal.addEventListener",WEBREQUESTINTERNAL_ADDEVENTLISTENER)protected:~WebRequestInternalAddEventListenerFunction() override = default;// ExtensionFunction:ResponseAction Run() override;
};class WebRequestInternalEventHandledFunction: public WebRequestInternalFunction {public:DECLARE_EXTENSION_FUNCTION("webRequestInternal.eventHandled",WEBREQUESTINTERNAL_EVENTHANDLED)protected:~WebRequestInternalEventHandledFunction() override = default;private:// Unblocks the network request. Use this function when handling incorrect// requests from the extension that cannot be detected by the schema// validator.void OnError(const std::string& event_name,const std::string& sub_event_name,uint64_t request_id,int render_process_id,int web_view_instance_id,std::unique_ptr<WebRequestEventRouter::EventResponse> response);// ExtensionFunction:ResponseAction Run() override;
};class WebRequestHandlerBehaviorChangedFunction: public WebRequestInternalFunction {public:DECLARE_EXTENSION_FUNCTION("webRequest.handlerBehaviorChanged",WEBREQUEST_HANDLERBEHAVIORCHANGED)protected:~WebRequestHandlerBehaviorChangedFunction() override = default;// ExtensionFunction:void GetQuotaLimitHeuristics(extensions::QuotaLimitHeuristics* heuristics) const override;// Handle quota exceeded gracefully: Only warn the user but still execute the// function.void OnQuotaExceeded(std::string error) override;ResponseAction Run() override;
};}  // namespace extensions

总结:

WebRequest API 接口c++定义介绍完毕,需要调试修改逻辑的可以在以上文件处更改。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/494464.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何实现圆形头像功能

文章目录 1 概念介绍2 使用方法3 示例代码我们在上一章回中介绍了Stack Widget,本章回中将介绍CircleAvatar这种Widget,闲话休提,让我们一起Talk Flutter吧。 1 概念介绍 在上一回中我们使用了CircleAvatar Widget,之前也没有介绍过此Widget,因此有些看官希望对它做一些介绍…

移动网络(2,3,4,5G)设备TCP通讯调试方法

背景&#xff1a; 当设备是移动网络设备连接云平台的时候&#xff0c;如果服务器没有收到网络数据&#xff0c;移动物联设备发送不知道有没有有丢失数据的时候&#xff0c;需要一个抓取设备出来的数据和服务器下发的数据的方法。 1.服务器系统是很成熟的&#xff0c;一般是linu…

解析在OceanBase创建分区的常见问题|OceanBase 用户问题精粹

在《分区策略和管理分区计划的实践方案》这篇文章中&#xff0c;我们介绍了在ODC中制定分区策略及有效管理分区计划的经验。有不少用户在该帖下提出了使用中的问题&#xff0c;其中一个关于创建分区的限制条件的问题&#xff0c;也是很多用户遭遇的老问题。因此本文以其为切入&…

重温设计模式--命令模式

文章目录 命令模式的详细介绍C 代码示例C代码示例2 命令模式的详细介绍 定义与概念 命令模式属于行为型设计模式&#xff0c;它旨在将一个请求封装成一个对象&#xff0c;从而让你可以用不同的请求对客户端进行参数化&#xff0c;将请求的发送者和接收者解耦&#xff0c;并且能…

NavMeshAgent直接transform.position移动报错

对于NavMeshAgent组件&#xff0c;如果直接用transform.position移动位置会报错如下&#xff1a; xxx can only be called on an active agent that has been placed on a NavMesh。 需要使用如下方法进行移动位置&#xff0c;先不激活&#xff0c;移动完毕再激活。 using Sy…

272-1路万兆光纤SFP+和1路千兆网络 FMC子卡模块

一、概述 该板卡是基于kc705和ml605的fmc 10g万兆光纤扩展板设计&#xff0c;提供了1路万兆光纤SFP和1路千兆网络接口。可搭配我公司开发的FPGA载卡使用。载卡可参考&#xff1a;ID204 SFP&#xff08;10 Gigabit Small Form Factor Pluggable&#xff09;是一种可…

GitCode 光引计划投稿|JavaVision:引领全能视觉智能识别新纪元

在人工智能技术飞速发展的今天&#xff0c;计算机视觉作为AI领域的重要分支&#xff0c;正逐渐渗透到各行各业中。JavaVision&#xff0c;作为[光引计划]的一部分&#xff0c;致力于提供一个基于Java的全能视觉智能识别解决方案。同时它集成了MilvusPlus&#xff0c;旨在提供一…

如何在自己的云服务器上部署mysql

如何在自己的云服务器上部署mysql 前言&#xff1a; 我是用的是阿里云服务器&#xff0c;我的服务器上安装的系统是Ubuntu 20.04&#xff0c;一下内容都是居于此撰写。 前期准备工作 远程链接自己的云服务器&#xff0c;这里给大家推荐一个好用的软件&#xff1a;FinalShel…

华院计算参与项目再次被《新闻联播》报道

12月17日&#xff0c;央视《新闻联播》播出我国推进乡村振兴取得积极进展。其中&#xff0c;华院计算参与的江西省防止返贫监测帮扶大数据系统被报道&#xff0c;该系统实现了由原来的“人找人”向“数据找人”的转变&#xff0c;有效提升监测帮扶及时性和有效性&#xff0c;守…

UML图【重要】

文章目录 2.1 类图概述2.2 类图的作用2.3 类图表示法2.3.1 类的表示方式2.3.2 类与类之间关系的表示方式2.3.2.1 关联关系2.3.2.2 聚合关系2.3.2.3 组合关系2.3.2.4 依赖关系2.3.2.5 继承关系2.3.2.6 实现关系 统一建模语言&#xff08;Unified Modeling Language&#xff0c;U…

【数据科学导论】第一二章·大数据与数据表示与存储

&#x1f308; 个人主页&#xff1a;十二月的猫-CSDN博客 &#x1f525; 系列专栏&#xff1a; &#x1f3c0;数据处理与分析_十二月的猫的博客-CSDN博客 &#x1f4aa;&#x1f3fb; 十二月的寒冬阻挡不了春天的脚步&#xff0c;十二点的黑夜遮蔽不住黎明的曙光 目录 1. 前言…

问题解决:发现Excel中的部分内容有问题。是否让我们尽量尝试恢复? 如果您信任此工作簿的源,请单击“是”。

在开发同步导出功能是遇到了如标题所示的问题&#xff0c;解决后遂记录下来供大家参考。 RestController public class XxxController {PostMapping("/export")public BaseResponse export(RequestBody PolicyErrorAnalysisExportReq exportReq, HttpServletRespons…

软件设计与体系结构

1.简要说明什么是软件体系结构&#xff0c;软件体系结构模型&#xff0c;为什么要建立软件体系结构模型&#xff1f; 答&#xff1a;软件体系结构指一个软件系统在高层次上的结构化组织方式&#xff0c;包括系统的组成部分和各个部分之间的关系&#xff0c;以及它们与环境之间的…

开发手札:CameraRTS精准性优化

虽然三维软件提供了基本的物体RTS操作&#xff0c;但是对于用户来说过于复杂。 这些操作方式需要用户理解什么是三维空间、XYZ坐标系、欧拉角等。但是用户视角下&#xff0c;就一个二维屏幕动来动去的鼠标光标。 之前写过一套RTM组件&#xff0c;RTM组件&#xff0…

高级的SQL查询技巧有哪些?

成长路上不孤单&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a; 【14后&#x1f60a;///C爱好者&#x1f60a;///持续分享所学&#x1f60a;///如有需要欢迎收藏转发///&#x1f60a;】 今日分享关于高级SQL查询技巧方面的相关内容&#xf…

helm的介绍和安装

1 helm概述 1.1 资源对象难以管理的问题 helm是k8s资源清单的管理工具&#xff0c;它就像Linux下的包管理器&#xff0c;比如centos的yum&#xff0c;ubuntu的apt helm&#xff1a;命令行工具&#xff0c;主要用于k8s的chart的创建&#xff0c;打包&#xff0c;发布和管理。…

专业的内外网数据交换方案 可解决安全、效率、便捷3大问题

内外网数据交换是很多企业和行业都会面临的场景&#xff0c;既然隔离了内外网&#xff0c;重中之重就是要确保数据的安全性&#xff0c;其次在数据流转交换过程中&#xff0c;不能太繁琐复杂&#xff0c;需要让用户快速、便捷的进行数据交换。首先我们来看看&#xff0c;在进行…

2024 楚慧杯 re wp

go_bytes 附件拖入ida 输入长度为0x28&#xff0c;每两位字符的4bit拼接 与一个常量值经过运算后的值进行异或&#xff0c;并且判断是否相等 脚本 bouquet 附件拖入ida。简单去一下花 构建了一个二叉树&#xff0c;然后递归调用函数 重新排列一下再层序遍历读出即可 zistel 附件…

BERT模型入门(1)BERT的基本概念

文章目录 BERT是Bidirectional Encoder Representations from Transformers的首字母简写&#xff0c;中文意思是&#xff1a;Transformer的双向编码器表示。它是谷歌发布的最先进的嵌入模型。BERT在许多NLP任务中提供了更好的结果&#xff0c;如问答、文本生成、句子分类等&…

ECharts关系图-关系图11,附视频讲解与代码下载

引言&#xff1a; 关系图&#xff08;或称网络图、关系网络图&#xff09;在数据可视化中扮演着至关重要的角色。它们通过节点&#xff08;代表实体&#xff0c;如人、物体、概念等&#xff09;和边&#xff08;代表实体之间的关系或连接&#xff09;的形式&#xff0c;直观地…