Skip to content

Commit

Permalink
Hack should be first
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed May 23, 2020
1 parent e8df840 commit 4beecbc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/content-script.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 4beecbc

Please sign in to comment.