fix: fix context invalidation when using reload keybind
This commit is contained in:
parent
439978a5b5
commit
7bc077a420
1 changed files with 10 additions and 3 deletions
|
|
@ -60,9 +60,16 @@ let Theme = ``;
|
|||
document.addEventListener("keypress", function (e) {
|
||||
currentCombination += e.key;
|
||||
if (currentCombination === combination && document.activeElement.tagName !== "INPUT" && document.activeElement.tagName !== "TEXTAREA") {
|
||||
console.log("Reloading Poly+...");
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
try {
|
||||
console.log("Reloading Poly+...");
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
} catch(error) {
|
||||
console.log("Reloading Poly+...");
|
||||
window.location.reload()
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
}
|
||||
} else if (!combination.startsWith(currentCombination)) {
|
||||
currentCombination = "";
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue