From f27622ab0653f0790a7bc9217c53dd2f7eb66660 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 11 Jul 2019 20:14:19 +0200 Subject: init: Add temporary F5 binding to reload a browser extension Working on a Chrome extension that displays an HTML interface through an extension-scoped URL. When I reload the extension, the page gets closed automatically. This mapping clicks the extension's button in the Chrome toolbar (the rightmost extension icon) to reopen the page. --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index b3baca8..dcea155 100644 --- a/init.lua +++ b/init.lua @@ -31,3 +31,12 @@ spoon.WindowMode:bindHotkeys({ mode = {{'ctrl', 'option'}, 'w'} }) hs.hotkey.bind({}, 'f8', function() hs.eventtap.keyStroke({'cmd', 'option', 'ctrl'}, '8') end) + +-- Temporary browser extension reload mapping +hs.hotkey.bind({}, 'f5', function() + local position = hs.window.frontmostWindow():zoomButtonRect() + position.x = position.x + 925 + position.y = position.y + 45 + + hs.eventtap.leftClick(position) +end) -- cgit v1.2.3