Skip to content

Commit

Permalink
fix: firefox 126 context menus are messed up (closes #295)
Browse files Browse the repository at this point in the history
  • Loading branch information
onemen committed Jun 3, 2024
1 parent f862b0b commit 459a4ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion addon/chrome/content/preferences/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ function loadData(pattern) {
pattern.splice(1, 0, pattern.splice(index, 1)[0]);

var prefName, prefValue;
Shortcuts.prefsChangedByTabmix = true;
for (let i = 1; i < pattern.length; i++) {
Shortcuts.prefsChangedByTabmix = true;
let valIndex = pattern[i].indexOf("=");
if (valIndex > 0) {
prefName = pattern[i].substring(0, valIndex);
Expand Down
7 changes: 0 additions & 7 deletions addon/chrome/content/preferences/shortcuts-ce.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,12 @@
event.stopPropagation();
event.stopImmediatePropagation();

console.log('handleKeyEvents', event, ctrl_w);

const key = {modifiers: "", key: "", keycode: ""};
const modifiers = ["ctrl", "meta", "alt", "altGr", "shift"];

console.log('event.getModifierState("AltGraph")', event.getModifierState("AltGraph"));
console.log('event.getModifierState("AltGr")', event.getModifierState("AltGr"), 'event.altGrKey', event.altGrKey);

key.modifiers = modifiers.filter(mod => event[mod + "Key"])
.join(",").replace("ctrl", "control");

console.log('key.modifiers', key.modifiers);

if (!key.modifiers) {
// Return and Esc blur the edit box
if (event.keyCode == event.DOM_VK_RETURN ||
Expand Down
6 changes: 2 additions & 4 deletions addon/modules/Shortcuts.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,8 @@ const Shortcuts = {
}
}

for (let att of Object.keys(keyAtt)) {
let val = keyAtt[att];
if (val)
keyItem.setAttribute(att, val);
for (let [att, val] of Object.entries(keyAtt)) {
keyItem.setAttribute(att, val || "");
}
// remove existing acceltext from menus
let items = document.getElementsByAttribute("key", keyItem.id);
Expand Down

0 comments on commit 459a4ec

Please sign in to comment.