禁用所有页面长按功能
This commit is contained in:
@@ -51,3 +51,22 @@ test("正式代码不包含历史人员、机台或重量模拟数据", async ()
|
||||
assert.match(page, /evaluateStability\(stableSamples\.current\)/);
|
||||
assert.match(utilities, /返回值统一为千克/);
|
||||
});
|
||||
|
||||
test("网页和 Android 原生层均禁用长按功能", async () => {
|
||||
const [css, androidActivity] = await Promise.all([
|
||||
readFile(new URL("../app/globals.css", import.meta.url), "utf8"),
|
||||
readFile(
|
||||
new URL(
|
||||
"../android-app/android/app/src/main/java/com/woer/smartscale/MainActivity.java",
|
||||
import.meta.url,
|
||||
),
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
|
||||
assert.match(css, /-webkit-touch-callout:\s*none/);
|
||||
assert.match(css, /-webkit-user-select:\s*none/);
|
||||
assert.match(css, /user-select:\s*none/);
|
||||
assert.match(androidActivity, /webView\.setLongClickable\(false\)/);
|
||||
assert.match(androidActivity, /webView\.setHapticFeedbackEnabled\(false\)/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user