forked from puppeteer/puppeteer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] add touchScreen.tap (puppeteer#639)
This patch: - adds `page.touchscreen` namespace, similar to `page.mouse` and `page.keyboard`. - adds tapping to multiple layers: - `page.touchscreen.tap` - `page.tap` - convenience method which accepts selector - `elementHandle.tap` Fixes puppeteer#568 and puppeteer#569.
- Loading branch information
1 parent
e95fb96
commit 64124df
Showing
8 changed files
with
147 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Touch test</title> | ||
</head> | ||
<body> | ||
<script src="mouse-helper.js"></script> | ||
<button onclick="clicked();">Click target</button> | ||
<script> | ||
window.result = []; | ||
const button = document.querySelector('button'); | ||
button.style.height = '200px'; | ||
button.style.width = '200px'; | ||
button.focus(); | ||
button.addEventListener('touchstart', event => { | ||
log('Touchstart:', ...Array.from(event.changedTouches).map(touch => touch.identifier)); | ||
}); | ||
button.addEventListener('touchend', event => { | ||
log('Touchend:', ...Array.from(event.changedTouches).map(touch => touch.identifier)); | ||
}); | ||
button.addEventListener('touchmove', event => { | ||
log('Touchmove:', ...Array.from(event.changedTouches).map(touch => touch.identifier)); | ||
}); | ||
function log(...args) { | ||
console.log.apply(console, args); | ||
result.push(args.join(' ')); | ||
} | ||
function getResult() { | ||
let temp = result; | ||
result = []; | ||
return temp; | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters