-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove hotkey.js script and replace var with const (#7343)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
- Loading branch information
1 parent
a2be88a
commit 71a0240
Showing
9 changed files
with
79 additions
and
72 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 was deleted.
Oops, something went wrong.
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,36 @@ | ||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
|
||
(function () { | ||
function toggleDevtoolsHotkey() { | ||
const isHotkey = navigator.appVersion.includes("Mac") | ||
? (event) => event.metaKey && event.altKey && event.key === "I" | ||
: (event) => event.ctrlKey && event.shiftKey && event.key === "I"; | ||
|
||
document.addEventListener("keydown", (event) => { | ||
if (isHotkey(event)) { | ||
window.__TAURI_INVOKE__('tauri', { | ||
__tauriModule: 'Window', | ||
message: { | ||
cmd: 'manage', | ||
data: { | ||
cmd: { | ||
type: '__toggleDevtools' | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
if ( | ||
document.readyState === "complete" || | ||
document.readyState === "interactive" | ||
) { | ||
toggleDevtoolsHotkey(); | ||
} else { | ||
window.addEventListener("DOMContentLoaded", toggleDevtoolsHotkey, true); | ||
} | ||
})(); |
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