browser(firefox): allow to override request url (#4436)
This commit is contained in:
parent
2e65f78874
commit
0167f8c182
|
|
@ -1,2 +1,2 @@
|
||||||
1207
|
1208
|
||||||
Changed: dgozman@gmail.com Fri Nov 13 14:41:15 PST 2020
|
Changed: yurys@chromium.org Fri 13 Nov 2020 02:55:31 PM PST
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ class PageNetwork {
|
||||||
this._interceptedRequests.clear();
|
this._interceptedRequests.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
resumeInterceptedRequest(requestId, method, headers, postData) {
|
resumeInterceptedRequest(requestId, url, method, headers, postData) {
|
||||||
this._takeIntercepted(requestId).resume(method, headers, postData);
|
this._takeIntercepted(requestId).resume(url, method, headers, postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
fulfillInterceptedRequest(requestId, status, statusText, headers, base64body) {
|
fulfillInterceptedRequest(requestId, status, statusText, headers, base64body) {
|
||||||
|
|
@ -180,9 +180,10 @@ class NetworkRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public interception API.
|
// Public interception API.
|
||||||
resume(method, headers, postData) {
|
resume(url, method, headers, postData) {
|
||||||
this._expectingResumedRequest = { method, headers, postData };
|
this._expectingResumedRequest = { method, headers, postData };
|
||||||
this._interceptedChannel.resetInterception();
|
const newUri = url ? Services.io.newURI(url) : null;
|
||||||
|
this._interceptedChannel.resetInterceptionWithURI(newUri);
|
||||||
this._interceptedChannel = undefined;
|
this._interceptedChannel = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class PageHandler {
|
||||||
pageNavigationAborted: emitProtocolEvent('Page.navigationAborted'),
|
pageNavigationAborted: emitProtocolEvent('Page.navigationAborted'),
|
||||||
pageNavigationCommitted: emitProtocolEvent('Page.navigationCommitted'),
|
pageNavigationCommitted: emitProtocolEvent('Page.navigationCommitted'),
|
||||||
pageNavigationStarted: emitProtocolEvent('Page.navigationStarted'),
|
pageNavigationStarted: emitProtocolEvent('Page.navigationStarted'),
|
||||||
pageReady: this._onPageReady.bind(this),
|
pageReady: this._onPageReady.bind(this),
|
||||||
pageSameDocumentNavigation: emitProtocolEvent('Page.sameDocumentNavigation'),
|
pageSameDocumentNavigation: emitProtocolEvent('Page.sameDocumentNavigation'),
|
||||||
pageUncaughtError: emitProtocolEvent('Page.uncaughtError'),
|
pageUncaughtError: emitProtocolEvent('Page.uncaughtError'),
|
||||||
pageWorkerCreated: this._onWorkerCreated.bind(this),
|
pageWorkerCreated: this._onWorkerCreated.bind(this),
|
||||||
|
|
@ -237,8 +237,8 @@ class PageHandler {
|
||||||
this._pageNetwork.disableRequestInterception();
|
this._pageNetwork.disableRequestInterception();
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Network.resumeInterceptedRequest']({requestId, method, headers, postData}) {
|
async ['Network.resumeInterceptedRequest']({requestId, url, method, headers, postData}) {
|
||||||
this._pageNetwork.resumeInterceptedRequest(requestId, method, headers, postData);
|
this._pageNetwork.resumeInterceptedRequest(requestId, url, method, headers, postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Network.abortInterceptedRequest']({requestId, errorCode}) {
|
async ['Network.abortInterceptedRequest']({requestId, errorCode}) {
|
||||||
|
|
|
||||||
|
|
@ -491,6 +491,7 @@ const Network = {
|
||||||
'resumeInterceptedRequest': {
|
'resumeInterceptedRequest': {
|
||||||
params: {
|
params: {
|
||||||
requestId: t.String,
|
requestId: t.String,
|
||||||
|
url: t.Optional(t.String),
|
||||||
method: t.Optional(t.String),
|
method: t.Optional(t.String),
|
||||||
headers: t.Optional(t.Array(networkTypes.HTTPHeader)),
|
headers: t.Optional(t.Array(networkTypes.HTTPHeader)),
|
||||||
postData: t.Optional(t.String),
|
postData: t.Optional(t.String),
|
||||||
|
|
|
||||||
|
|
@ -1595,6 +1595,37 @@ index 25c5b01fc54c8d45da8ceb7cf6ba163bee3c5361..490c5ce49cd9b5f804df59abbfb0450f
|
||||||
void updateTimeZone();
|
void updateTimeZone();
|
||||||
|
|
||||||
void internalResyncICUDefaultTimeZone();
|
void internalResyncICUDefaultTimeZone();
|
||||||
|
diff --git a/netwerk/base/nsINetworkInterceptController.idl b/netwerk/base/nsINetworkInterceptController.idl
|
||||||
|
index 64a4a71b03b28872f376aac8eee12805bebd1bd8..f6fa7d731f3b0c7c4fcb26babad3fc2cdb29aec1 100644
|
||||||
|
--- a/netwerk/base/nsINetworkInterceptController.idl
|
||||||
|
+++ b/netwerk/base/nsINetworkInterceptController.idl
|
||||||
|
@@ -56,6 +56,7 @@ interface nsIInterceptedChannel : nsISupports
|
||||||
|
* network request.
|
||||||
|
*/
|
||||||
|
void resetInterception();
|
||||||
|
+ void resetInterceptionWithURI(in nsIURI aURI);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the status and reason for the forthcoming synthesized response.
|
||||||
|
diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp
|
||||||
|
index 86dfc4c832ab53b2dab6ac2ca7c63bd9ef326d4a..b004db5e5effd9bbcb0c4c530c13d33120a9da44 100644
|
||||||
|
--- a/netwerk/protocol/http/InterceptedHttpChannel.cpp
|
||||||
|
+++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp
|
||||||
|
@@ -601,6 +601,14 @@ void InterceptedHttpChannel::DoAsyncAbort(nsresult aStatus) {
|
||||||
|
Unused << AsyncAbort(aStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
+NS_IMETHODIMP
|
||||||
|
+InterceptedHttpChannel::ResetInterceptionWithURI(nsIURI* aURI) {
|
||||||
|
+ if (aURI) {
|
||||||
|
+ mURI = aURI;
|
||||||
|
+ }
|
||||||
|
+ return ResetInterception();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
NS_IMETHODIMP
|
||||||
|
InterceptedHttpChannel::ResetInterception(void) {
|
||||||
|
if (mCanceled) {
|
||||||
diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp
|
diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp
|
||||||
index 1296a8b380f1ae1bb53ee25d1b2374dbf060fbb6..c1bea93fc8e7e9459f6f358bc91da820702197d2 100644
|
index 1296a8b380f1ae1bb53ee25d1b2374dbf060fbb6..c1bea93fc8e7e9459f6f358bc91da820702197d2 100644
|
||||||
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
|
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue