Thursday, November 16, 2017

Firefox 57 and lost some shortcuts on mac

There was an old plugin called Customizeable Shortcuts that hadn't been updated for while and was not usable with Firefox 57. I was using it to remap the 'search location bar' shortcut.

Since I already use karabiner to remap some modifier keys for macos, it might be able to use it instead of waiting for a new firefox shortcut addon.

Note: If you're confused by the left_option/left_command it's cause I've first remap left_command to left_option.

1) Have a look at some of the examples for karabiner shortcuts
https://pqrs.org/osx/karabiner/complex_modifications/#key_specific

2) Create a json and take note of the path

{
  "title": "Firefox command-d search location",
  "rules": [
    {
      "description": "command-d search location",
      "manipulators": [
        {
          "type": "basic",
          "from": {
              "key_code": "d",
              "modifiers": {
                  "mandatory": ["left_option"],
                  "optional": ["any"]
              }
          },
          "to": [
              {
                "key_code": "l",
                "modifiers": [
                  "left_command"
                ]
              }
          ],
          "conditions": [
            {
              "type": "frontmost_application_if",
              "bundle_identifiers": [
                "^org\\.mozilla\\.firefox"
              ]
            }
          ]
        }
      ]
    }
  ]
}


I saved this to my desktop with the name firefox-command-d.json

What is going on? frontmost_application_if only runs the above shortcuts if it's the app focused.
bundle_identifiers is your app id that you can find in the plist.

3) Now run enter this in the url bar in firefox: karabiner://karabiner/assets/complex_modifications/import?url=file:///Users//Desktop/firefox-command-d.json

Enable this and you have your remap.