Skip to content

Instantly share code, notes, and snippets.

@leohxj
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save leohxj/01a96602460255f5820d to your computer and use it in GitHub Desktop.

Select an option

Save leohxj/01a96602460255f5820d to your computer and use it in GitHub Desktop.
UC浏览器关闭默认手势和长按弹出菜单
// UC-U3内核JavaScript专用API
// (经测试,官方文档给出的API很多也不能使用,下面只列出测试能用的)
// 1. 关闭默认手势
// 用法:
navigator.control.gesture(false);
// 推荐写法:
try {
navigator.control.gesture(false);
} catch (e) {
}
// 2. 关闭长按弹出菜单
// 用法:
navigator.control.longpressMenu(false);
// 推荐写法:
try {
navigator.control.longpressMenu(false);
} catch (e) {}
var control = navigator.control || {};
if (control.gesture) {
control.gesture(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment