I have a problem, where I need to route HTTP requests from the IOS WebView through a HTTP proxy.
The intention is to route it through a HTTP proxy running Privoxy, so all tracking scripts and ads are removed. I want to provide a free app on the appstore, where people can browse without having to view ads and being tracked.
It seems that it is possible somehow with the UIWebView, but since it has become deprecated, I could imagine that other issues would start popping op, if I used that... I have not been able to find any sources officially nor unofficially, if the newer WKWebView can do this. If any of you know this and would share your knowledge on it, it would be much appreciated.
I have so far developed my full app in React Native, which seems to have no way of doing this at all, so before redeveloping everything in Swift, I want to make a bit more sure that it is actually possible there and thus meaningful to change...
Not possible with react native webview:
https://github.com/react-native-community/react-native-webview/issues/115
Related
I'm trying to add some content filtering into my iOS app. Namely, I'd like if it could block certain URLs. I've poked around with some VPN stuff, but I'm getting lost. My basic understanding is that I need to create a Personal VPN using NetworkExtension and then I'll still need a server to point to where the content filtering will actually happen.
Other than that I've seen some mention of using a custom VPN to do the filtering on the client side (on the iPhone / iPad). I've ruled out using a content filter, as that only works for monitored devices.
What I'm trying to get more info on is:
How do I create a personal or custom VPN?
How do I spin up a server to filter this content? Could I use aws lambda?
I've read through all of these:
https://kean.blog/post/vpn-configuration-manager
https://stackoverflow.com/a/58992921/3320342
https://developer.apple.com/forums/thread/96777
https://developer.apple.com/forums/thread/74464?answerId=218089022#218089022
But I'm still stumped. Any pointing in the right direction would be greatly appreciated.
I just added SSL to my backend framework (Django REST API) and I want my iOS application to talk to it. Do I have to do anything differently on the iOS side of my project? How do I tell Alamofire to encrypt the data its sending? Or Does it happen automatically?
The only difference is using https instead of http. I have the same setup at work, and originally thought I was going to have to delve into certificates. I started heading in that direction and then realized all my requests worked as soon as I stuck the "s" on the end.
I will say, while using NSStream, you do have to setup the stream to handle the certificate. I am doing this in another application, but that is below the URLRequest class. I am unsure of how low level Alomofire actually delves, but it will definitely handle everything you desire without doing anything differently.
Just update URLs inside your app to use "https" and you are done.
Clicking a mailto: link will open my default mail client. In a similar manner, I would like to launch an Electron app with my-app:. What is the best way to achieve this and gracefully fallback to a standard http link if the app isn't installed?
Furthermore, I would also like to be able to pass through some extra details my-app:foo/bar. How would this be intercepted inside of Electron when it launches?
I have read some docs on what I think might be relevant stuff: http://electron.atom.io/docs/v0.36.0/api/protocol/ however as a frontend dev there's some gaps in my understanding of how the overarching process works. Any help much appreciated!
Electron has evolved quite a bit since this question was first posted.
You no longer have to dive quite as deep and can skip the Electron protocol API. Instead, use the app.setAsDefaultProtocolClient(protocol[, path, args]) interface and its siblings app.removeAsDefaultProtocolClient(protocol[, path, args]) and app.isDefaultProtocolClient(protocol[, path, args]).
These enable you to register a protocol identifier your-protocol:// and receive arguments:
The whole link, including protocol, will be passed to your application
as a parameter. Electron API docs
I'm not sure if it is possible to do what you want to do. Depending on whether you want to launch your Electron app from an actual browser window or simply from another Electron instance.
I found this other Stack Overflow post link that shows a workaround (though I'm afraid it won't graciously default to anything) and explains how it could be dangerous to launch programs directly from the browser.
If you want to launch your Electron app from another Electron app however you might want to check this out link.
I'm communicating with an API that requires I use a particular user-agent string. The format for this is basically User-Agent: IOS_USER_AGENT API_CUSTOM_AGENT
Upon investigation I discovered that people would use UIWebView and apply a javascript function to extract the system user agent string. Now that UIWebView is deprecated, its replacement WKWebView offers an asynchronous means of calculating the user agent (not ideal for my purposes).
Is there any way to extract some form of the iOS user agent string without needing to randomly create some off-screen web view. Especially with SFSafariViewController I don't think its entirely impossible that these web views become deprecated in future.
I know that Apps like WhatsApp and Facebook use the system User-Agent see here. The question is, what is the most reliable way of achieving this without involving web view trickery?
I'm writing an application, which becomes "useful" once user is browsing certain url.
I want to add feature to my application, that it will be automatically launched once user browses this url, I was thinking of writing some sort of watchdog to trigger it.
My question is, whether there is a generic way to get notified when user browses to urls, I want to support at least IE and FireFox, chrome and safari is nice to have.
I read about DDE and WWW_RegisterURLEcho, but from what I understand it's not supported by FireFox, and also little sample I wrote didn't work with IE as well.
Thank you in advance
some more questions **
Do Url Monikers and Asynchronous Pluggable Protocols help me here ? Is it supported by FireFox ?
If you have control over the website, you could have it write a cookie to the computer. Then have your application monitor for that cookie.
You can implement this in many ways and at many different layers.
At the highest level, you could implement a browser plugin. There is no cross-browser solution at this layer that will let you write the code once and work for every browser. On the easy end of the spectrum, Firefox, you could implement it entirely as a Javascript + XUL plugin and use built-in XPCom interfaces (nsIProcess) for launching your helper process. For IE you would need to write a COM, C++ and win32 BHO that handles DWebBrowserEvents2::BeforeNavigate2. This is the hardest thing to do. There are mechanisms for Safari, Chrome and other webbrowsers that you could use to achieve this same behavior, with varying degrees of difficulty.
At the next level you could implement an HTTP proxy, similar to Fiddler2, that redirects all HTTP traffic through your local proxy first. Each browser has a different way of configuring its proxy settings, but they're all basically registry settings or config files.
At the most basic level you could just snif all IP traffic going out of the machine, similar to the way Wireshark does it, and just look for http requests to your URL. This is probably more difficult to code, but would work for all browsers without any special per-browser configuration stuff going on. You may need to write a driver. I dunno, I've never done work at this level in the stack.