diff --git a/src/content-script.js b/src/content-script.js index c891ac0..7de761f 100644 --- a/src/content-script.js +++ b/src/content-script.js @@ -1,4 +1,10 @@ (() => { + if (location.host === "scrapbox.io") { + // Dirty hack for mimicking 'non-touchable device (normal Mac)' to Scrapbox + // (as of 5/24 2020, it uses `ontouchstart === undefined` to check whether the device is iPadOS or not) + Object.defineProperty(document, "ontouchstart", { get: () => void 0 }); + } + let beginTime = Date.now(); function log(message) { @@ -646,10 +652,6 @@ } function initializeScrapbox() { - // Dirty hack for mimicking 'non-touchable device (normal Mac)' to Scrapbox - // (as of 5/24 2020, it uses `ontouchstart === undefined` to check whether the device is iPadOS or not) - Object.defineProperty(document, "ontouchstart", { get: () => void 0 }); - gRichTextEditorInputElement = document.getElementById("text-input"); setupInCompositionHandler(gRichTextEditorInputElement, ev => keysnail.dispatchKey("Backspace")