You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/09/02 08:28:09 UTC
[GitHub] [cordova-ios] stupidchou opened a new issue, #1252: https requests cannot be intercepted by NSURLProtocol
stupidchou opened a new issue, #1252:
URL: https://github.com/apache/cordova-ios/issues/1252
### Issue Type
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] Bug Report
- [ ] Feature Request
- [x] Support Question
## Description
When I call the https request, I want to use the local js file and find that the local js cannot be intercepted
## Information
When using cordova to access remote html, I use <script src="ebeiapp://cordova.js"> to call my local js in html, and [NSURLProtocol wk_registerScheme:@"ebeiapp"] has been executed in iOS, Intercepted but https request NSURLProtocol interception did not take effect.
### Command or Code
[NSURLProtocol wk_registerScheme:@"ebeiapp"];
[NSURLProtocol registerClass:[EBURLProtocol class]];
https remote html, the following method does not execute
+ (BOOL)canInitWithRequest:(NSURLRequest*)theRequest
{
NSURL* theUrl = [theRequest URL];
if ([[theUrl absoluteString] hasPrefix:@"ebeiapp"]) {
return YES;
}
else {
if ([[theUrl absoluteString] hasPrefix:@"assets-library://"]) {
return YES;
}
return NO;
}
}
### Environment, Platform, Device
iOS
### Version information
Cordova: Cordova Plugins
Other Frameworks: Xcode
## Checklist
<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
- [ ] I searched for already existing GitHub issues about this
- [x] I updated all Cordova tooling to their most recent version
- [x] I included all the necessary information above
Looking forward to your reply
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] jcesarmobile closed issue #1252: https requests cannot be intercepted by NSURLProtocol
Posted by GitBox <gi...@apache.org>.
jcesarmobile closed issue #1252: https requests cannot be intercepted by NSURLProtocol
URL: https://github.com/apache/cordova-ios/issues/1252
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] jcesarmobile commented on issue #1252: https requests cannot be intercepted by NSURLProtocol
Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #1252:
URL: https://github.com/apache/cordova-ios/issues/1252#issuecomment-1238694110
Yeah, WKWebView doesn't allow to intercept http/https requests, it's a know limitation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-ios] stupidchou commented on issue #1252: https requests cannot be intercepted by NSURLProtocol
Posted by GitBox <gi...@apache.org>.
stupidchou commented on issue #1252:
URL: https://github.com/apache/cordova-ios/issues/1252#issuecomment-1259059638
> 是的,WKWebView 不允许拦截 http/https 请求,这是一个已知的限制。
I now need to intercept remote html and inject cordova.js, what should I do?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org