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) {
|
document.addEventListener("keypress", function (e) {
|
||||||
currentCombination += e.key;
|
currentCombination += e.key;
|
||||||
if (currentCombination === combination && document.activeElement.tagName !== "INPUT" && document.activeElement.tagName !== "TEXTAREA") {
|
if (currentCombination === combination && document.activeElement.tagName !== "INPUT" && document.activeElement.tagName !== "TEXTAREA") {
|
||||||
|
try {
|
||||||
console.log("Reloading Poly+...");
|
console.log("Reloading Poly+...");
|
||||||
chrome.runtime.sendMessage({ action: "reload" });
|
chrome.runtime.sendMessage({ action: "reload" });
|
||||||
window.location.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)) {
|
} else if (!combination.startsWith(currentCombination)) {
|
||||||
currentCombination = "";
|
currentCombination = "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue