Change Phonegap User Agent

后端 未结 6 2005
独厮守ぢ
独厮守ぢ 2020-12-08 17:30

My Phonegap application is allowed to browse to some external sites that also use the Phonegap API. Currently I am conditionally including the Phonegap javascript based on

6条回答
  •  [愿得一人]
    2020-12-08 18:05

    I couldn't get this to work in iOS using Cordova 3.3, presumably because of CB-2520 but, as a hack, I modified CDVViewController.h to make the userAgent property readwrite, and then simply updated self.userAgent in the viewDidLoad of my controller that inherits from CDVViewController.

    If timing is an issue, you could forcibly manipulate the userAgent lazy-loaded property in CDVViewController.m.

    Both of these are very dirty. :)

提交回复
热议问题