美文网首页
fusionapp之万能去广告UA转换功能

fusionapp之万能去广告UA转换功能

作者: 辣辣不乖 | 来源:发表于2020-02-21 12:03 被阅读0次

之前玩的一个高级网页转应用APP的笔记

print"功能菜单"
items={}
table.insert(items,"去广告UA")
AlertDialog.Builder(this)
.setTitle("功能菜单")
.setItems(items,{onClick=function(l,v)
if items[v+1]=="去广告UA" then
  pop=PopupMenu(activity,view)
  menu=pop.Menu
  menu.add("万能").onMenuItemClick=function()
    webView.settings.setUserAgentString("Mozilla/5.0 Dalvik/2 ( Linux; U; NEM-AL10 Build/HONORNEM-AL10;Youku;7.1.4;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Safari/537.36 (Baidu; P1 6.0) iPhone/7.1 Android/8.0 baiduboxapp/2.7.0.10")
    webView.reload()
  end
  menu.add("安卓").onMenuItemClick=function()
    webView.settings.setUserAgentString("mixiaBrowser/Mozilla/5.0 (Linux; U; Android 7.1.2; zh-cn; Redmi 5 Plus Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Mobile Safari/537.36")
    webView.reload()
  end
  menu.add("苹果").onMenuItemClick=function()
    webView.settings.setUserAgentString("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7")
    webView.reload()
  end
  menu.add("塞班").onMenuItemClick=function()
    webView.settings.setUserAgentString("Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/012.002; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML,like Gecko) NokiaBrowser/7.3.0 Mobile Safari/533.4 3gpp-gba")
    webView.reload()
  end
  pop.show()--显示
end
end})
.show()

相关文章

网友评论

      本文标题:fusionapp之万能去广告UA转换功能

      本文链接:https://www.haomeiwen.com/subject/ixhlqhtx.html