diff --git a/CHANGELOG.md b/CHANGELOG.md index ccceb73..1775c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [0.0.6] - 2025-01-24 + +- Add support for StartPage (bookmarks, etc) +- Add fallback to mouse click when no AXPress action is available +- Improve root element detection +- Improve char mapping to other non-common symbols +- Add default mapping of Delete (backspace) to history back + ## [0.0.5] - 2025-01-22 - Fix release version diff --git a/README.md b/README.md index 0dd1881..f93b3cc 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,11 @@ Vimium/Vimari for Safari without browser extension in pure Lua. - Not a browser extension - works via accessability API, so most probably will work with any Safari version despite past or future Plugin API changes. Theoretically, it is even easily adjustable for other browsers. Works in all Safari parts - e.g. doesn't -stall on empty pages (plans are even to make `f`/`F` work on bookmarks and similar pages, -scrolling already works there). +stall on empty pages, works on Start Page (for bookmarks), etc. - No Swift/XCode - only Lua. Just a single text file. -- No need for Apple Developer account, etc. No distribution. +- No need for Apple Developer account, etc. No distribution via App Store. - Fully trustable from security perspective, because it is FOSS with Lua readable by any programmer. No keylogging risk and ok to run on sensitive sites with credentials/tokens/etc. @@ -107,6 +106,7 @@ x - close tab t - new tab o - open [] - back and forward in history +del (backspace) - back in history g1-8 - go to tab 1-8 g9, g$ - go to last tab @@ -144,8 +144,7 @@ g/f/F/t/y/... - or other symbols show multi-key combination start - If something unsolvable happens - hit reload config in Hammerspoon. -- Atm, there is a config for Spotlight and Raycast (as I have those). If somebody will send configs for other - app launchers, I will happily add those. +- Bookmarks, reading list, iCloud tabs, etc. are accessible via Start Page where `f` works (not `F`). ## Known issues @@ -154,9 +153,8 @@ happens in times of Safari's unresponsiveness - e.g. processing a heavy page jus ## Possible next todo ideas -- Extend marks to bookmarks, reading list, etc. non-web items. - Analog of `f` command but for toolbar, tabbar, etc. -- Bitwarden support by keypress +- Bitwarden/1Password support by keypress ## Similar projects diff --git a/init.lua b/init.lua index 6d2e936..476be9e 100644 --- a/init.lua +++ b/init.lua @@ -6,7 +6,7 @@ obj.__index = obj -------------------------------------------------------------------------------- obj.name = "vifari" -obj.version = "0.0.5" +obj.version = "0.0.6" obj.author = "Sergey Tarasov " obj.homepage = "https://github.com/dzirtusss/vifari" obj.license = "MIT - https://opensource.org/licenses/MIT" @@ -34,6 +34,7 @@ local mapping = { ["t"] = { "cmd", "t" }, -- new tab ["o"] = { "cmd", "l" }, -- open ["["] = { "cmd", "[" }, -- history back + ["\x7f"] = { "cmd", "[" }, -- history back (backspace) ["]"] = { "cmd", "]" }, -- history forward ["g1"] = { "cmd", "1" }, ["g2"] = { "cmd", "2" }, @@ -66,6 +67,10 @@ local config = { smoothScrollHalfPage = true, axEditableRoles = { "AXTextField", "AXComboBox", "AXTextArea" }, axJumpableRoles = { "AXLink", "AXButton", "AXPopUpButton", "AXComboBox", "AXTextField", "AXMenuItem", "AXTextArea", "AXCheckBox" }, + -- chars that are acceptable for vimLoop + -- feel free to add more if needed, and ping me on GH to add to the repo + -- \x7f is delete (backspace) on MacBook keyboard + acceptableChars = "[%a%d%[%]%$\x7f\"\\']", } -------------------------------------------------------------------------------- @@ -533,7 +538,7 @@ local function vimLoop(char) elseif mappingPrefixes[char] then setMode(modes.MULTI, char) else - logWithTimestamp("Unknown char " .. char) + logWithTimestamp("Unknown char " .. char .. " (hex: " .. string.format("%02x", string.byte(char)) .. ")") end end @@ -569,7 +574,7 @@ local function eventHandler(event) if current.mode == modes.INSERT or isEditableControlInFocus() then return false end local char = event:getCharacters() - if not char:match("[%a%d%[%]%$]") then return false end + if not char:match(config.acceptableChars) then return false end hs.timer.doAfter(0, function() vimLoop(char) end) return true