![]() ![]() ![]() For a top-level document, documentUrl is undefined. ![]() For example, if the web page at " " contains an image or an iframe, then the documentUrl for the image or iframe will be "". URL of the document in which the resource will be loaded. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. "requestBody": include requestBody in the details object passed to the listener."blocking": make the request synchronous, so you can cancel or redirect the request.You can pass any of the following values: A filter that restricts the events that will be sent to this listener. This enables the listener to process the request asynchronously. From Firefox 52 onwards, instead of returning BlockingResponse, the listener can return a Promise which is resolved with a BlockingResponse. If "blocking" is specified in the extraInfoSpec parameter, the event listener should return a BlockingResponse object, and can set either its cancel or its redirectUrl properties. The function will be passed the following arguments: details Syntaxįunction that will be called when this event occurs. If you use "blocking", you must have the "webRequestBlocking" API permission in your manifest.json. So if you canceled a request, you might see another request with the same requestId again if another blocking handler redirected the request.įrom Firefox 52 onwards, instead of returning BlockingResponse, the listener can return a Promise which is resolved with a BlockingResponse. Redirects and cancellations have the same precedence. When multiple blocking handlers modify a request, only one set of modifications take effect. HTTPS) URL to an extension page, the extension's manifest.json file must contain a web_accessible_resources key that lists the URL for the extension page. If an extension wants to redirect a public (e.g. to redirect the request, include a property redirectUrl with the value set to the URL to which you want to redirect.to cancel the request, include a property cancel with the value true.Then, in the listener function, return a BlockingResponse object, setting the appropriate property: To cancel or redirect the request, first include "blocking" in the extraInfoSpec array argument to addListener(). This is a good place to listen if you want to cancel or redirect the request. This event is triggered when a request is about to be made, and before headers are available. MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES.Differences between API implementations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |