Comments (4)
I was able to solve this without touching the code of DZNWebViewController. I've added the following snippet in my application(...didFinishLaunchingWithOptions: ...)
if let bundleName = NSBundle.mainBundle().infoDictionary?["CFBundleName"] as? String,
let bundleVersion = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String,
let defaultUserAgent = UIWebView().stringByEvaluatingJavaScriptFromString("navigator.userAgent"){
NSUserDefaults.standardUserDefaults().registerDefaults([
"UserAgent": defaultUserAgent + " \(bundleName)/\(bundleVersion)"
])
}
from dznwebviewcontroller.
Why not using the iPhone/iPad user agent?
from dznwebviewcontroller.
Because of the reason I've mentioned...?
These website features should only be hidden if the site is embedded in App. If the website is visitted by a regular browser everything can be showed - even in Safari on iPhone.
from dznwebviewcontroller.
You could have used NSURLProtocol
too, to append this user agent to either all outgoing requests, or the ones from the in-app browser.
from dznwebviewcontroller.
Related Issues (20)
- Turbolinks not enabling back/forward buttons HOT 1
- HTTP urls not working please help me on this HOT 2
- Dismissing during page load causes KVO crash HOT 10
- Loading URLs HOT 1
- Carthage support? HOT 5
- Required load request method HOT 3
- Support for popupwindow in few websites HOT 3
- toolbarHidden HOT 1
- EXC_BAD_ACCESS
- How to dismiss the view? HOT 4
- how to play video in website HOT 1
- Undefined symbols for architecture x86_64: HOT 1
- Warnings in Xcode 8.3 and Swift 3.1
- Carthage install not working
- toolbar block bottom of website content
- post method
- URL loads but don't get callback of didFinish Navigation method or other callback methods HOT 1
- iOS 11 status bar overlaps with DZWebViewController top bar HOT 1
- Problems with Apple Review
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dznwebviewcontroller.