mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
Minimal android compatibility
Note that Samsung devices can't handle (hover: none) media query
This commit is contained in:
@@ -129,7 +129,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
||||
var __updateOnlineLeds = function() {
|
||||
let is_captured;
|
||||
if (__absolute) {
|
||||
is_captured = (__stream_hovered || tools.browser.is_ios);
|
||||
is_captured = (__stream_hovered || tools.browser.is_mobile);
|
||||
} else {
|
||||
is_captured = __isRelativeCaptured();
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export function Ocr(__getGeometry) {
|
||||
/************************************************************************/
|
||||
|
||||
self.setState = function(state) {
|
||||
let enabled = (state && state.ocr.enabled && navigator.clipboard && !tools.browser.is_ios);
|
||||
let enabled = (state && state.ocr.enabled && navigator.clipboard && !tools.browser.is_mobile);
|
||||
if (enabled) {
|
||||
let selected = tools.storage.get("stream.ocr.lang", state.ocr.langs["default"]);
|
||||
let html = "";
|
||||
|
||||
@@ -372,14 +372,6 @@ export var tools = new function() {
|
||||
// Blink engine detection
|
||||
let is_blink = ((is_chrome || is_opera) && !!window.CSS);
|
||||
|
||||
// iOS browsers
|
||||
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
|
||||
// https://github.com/lancedikson/bowser/issues/329
|
||||
let is_ios = (!!navigator.platform && (
|
||||
/iPad|iPhone|iPod/.test(navigator.platform)
|
||||
|| (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 && !window["MSStream"])
|
||||
));
|
||||
|
||||
// Any browser on Mac
|
||||
let is_mac = ((
|
||||
window.navigator.oscpu
|
||||
@@ -391,15 +383,27 @@ export var tools = new function() {
|
||||
// Any Windows
|
||||
let is_win = (navigator && !!(/win/i).exec(navigator.platform));
|
||||
|
||||
// iOS browsers
|
||||
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
|
||||
// https://github.com/lancedikson/bowser/issues/329
|
||||
let is_ios = (!!navigator.platform && (
|
||||
/iPad|iPhone|iPod/.test(navigator.platform)
|
||||
|| (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 && !window["MSStream"])
|
||||
));
|
||||
|
||||
let is_android = /android/i.test(navigator.userAgent);
|
||||
|
||||
return {
|
||||
"is_opera": is_opera,
|
||||
"is_firefox": is_firefox,
|
||||
"is_safari": is_safari,
|
||||
"is_chrome": is_chrome,
|
||||
"is_blink": is_blink,
|
||||
"is_ios": is_ios,
|
||||
"is_mac": is_mac,
|
||||
"is_win": is_win,
|
||||
"is_ios": is_ios,
|
||||
"is_android": is_android,
|
||||
"is_mobile": (is_ios || is_android),
|
||||
};
|
||||
};
|
||||
self.info("Browser:", self.browser);
|
||||
|
||||
@@ -362,7 +362,7 @@ function __WindowManager() {
|
||||
var __organizeWindowsOnBrowserResize = function() {
|
||||
for (let el_window of $$("window")) {
|
||||
if (el_window.style.visibility === "visible") {
|
||||
if (tools.browser.is_ios && el_window.classList.contains("window-resizable")) {
|
||||
if (tools.browser.is_mobile && el_window.classList.contains("window-resizable")) {
|
||||
// FIXME: При смене ориентации на мобильном браузере надо сбрасывать
|
||||
// настройки окна стрима, поэтому тут стоит вот этот костыль
|
||||
el_window.style.width = "";
|
||||
|
||||
Reference in New Issue
Block a user