Add keyboard shortcut
This commit is contained in:
parent
915e0fe189
commit
902bfe950e
|
@ -30,4 +30,9 @@ document.querySelectorAll('input,select').forEach(function (el) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Open keyboard shortcut
|
||||||
|
document.querySelector('#mastodon-keyboard-shortcut').addEventListener('click', function() {
|
||||||
|
chrome.tabs.create({ url: 'chrome://extensions/shortcuts#:~:text=Share%20to%20Mastodon' })
|
||||||
|
})
|
||||||
|
|
||||||
loadSettings()
|
loadSettings()
|
|
@ -17,6 +17,12 @@
|
||||||
},
|
},
|
||||||
"default_title": "Share this page to Mastodon"
|
"default_title": "Share this page to Mastodon"
|
||||||
},
|
},
|
||||||
|
"commands": {
|
||||||
|
"_execute_action": {
|
||||||
|
"suggested_key": "Ctrl+Shift+S",
|
||||||
|
"description": "Share current page on Mastodon"
|
||||||
|
}
|
||||||
|
},
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"contextMenus",
|
"contextMenus",
|
||||||
"storage",
|
"storage",
|
||||||
|
|
|
@ -17,14 +17,18 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<!-- Alert for no server -->
|
<!-- Alert for no server -->
|
||||||
<div class="alert alert-primary d-none" id="mastodon-server-alert" role="alert">
|
<div class="alert alert-primary d-none mb-3" id="mastodon-server-alert" role="alert">
|
||||||
You have to enter a server before you can share links!
|
You have to enter a server before you can share links!
|
||||||
</div>
|
</div>
|
||||||
<!-- Server select -->
|
<!-- Server select -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="exampleFormControlInput1" class="form-label">Mastodon server</label>
|
<label for="mastodon-server" class="form-label">Mastodon server</label>
|
||||||
<input type="text" class="form-control" id="mastodon-server" placeholder="yourserver.social" disabled>
|
<input type="text" class="form-control" id="mastodon-server" placeholder="yourserver.social" disabled>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Link to keyboard shortcut -->
|
||||||
|
<div class="mb-3">
|
||||||
|
<button type="button" class="btn btn-sm btn-primary w-100" id="mastodon-keyboard-shortcut">Change keyboard shortcut</button>
|
||||||
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<p>If you find Share to Mastodon useful, please donate to support continued development. It would mean a lot!</p>
|
<p>If you find Share to Mastodon useful, please donate to support continued development. It would mean a lot!</p>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
|
Loading…
Reference in New Issue