parent
952b24ecaf
commit
4d8366f323
File diff suppressed because one or more lines are too long
@ -1,3 +1,26 @@
|
||||
window.hotkeys(navigator.appVersion.includes('Mac') ? 'command+option+i' : 'ctrl+shift+i', () => {
|
||||
window.__TAURI_INVOKE__('plugin:window|internal_toggle_devtools');
|
||||
});
|
||||
// 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__('plugin:window|internal_toggle_devtools');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
document.readyState === 'complete' ||
|
||||
document.readyState === 'interactive'
|
||||
) {
|
||||
toggleDevtoolsHotkey()
|
||||
} else {
|
||||
window.addEventListener('DOMContentLoaded', toggleDevtoolsHotkey, true)
|
||||
}
|
||||
})()
|
||||
|
Loading…
Reference in new issue