diff --git a/examples/embedded.html b/examples/embedded.html index e4bf4cf..cefb906 100644 --- a/examples/embedded.html +++ b/examples/embedded.html @@ -13,6 +13,7 @@ margin: 0; -webkit-scroll-snap-type: mandatory; -webkit-scroll-snap-points-x: repeat(100%); + -webkit-overflow-scrolling: auto; /*This scroll snap functionality is part of a polyfill that enables the functionality in Chrome.*/ @@ -75,6 +76,116 @@ }); + diff --git a/src/contents.js b/src/contents.js index 2c9f819..d797e02 100644 --- a/src/contents.js +++ b/src/contents.js @@ -8,7 +8,8 @@ import { Pane, Highlight, Underline } from "marks-pane"; // Dom events to listen for const EVENTS = ["keydown", "keyup", "keypressed", "mouseup", "mousedown", "click", "touchend", "touchstart"]; -const isWebkit = /AppleWebKit/.test(navigator.userAgent); +const isChrome = /Chrome/.test(navigator.userAgent); +const isWebkit = !isChrome && /AppleWebKit/.test(navigator.userAgent); const ELEMENT_NODE = 1; const TEXT_NODE = 3;