From c3054d1f23965a2940f54ebebe7bc5af9e66dc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Wed, 21 Aug 2024 11:14:58 +0200 Subject: [PATCH] Made yr script more mac compatible... hopefully --- yr.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yr.user.js b/yr.user.js index f3bb6d2..74a17da 100644 --- a/yr.user.js +++ b/yr.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name YR Hotkeys // @namespace http://tampermonkey.net/ -// @version 1.1.1 +// @version 1.1.2 // @description Hotkeys 'alt+l', 'alt+r', or 'alt+v' for yr.no // @author on@ntnu.no // @match https://www.yr.no/* @@ -15,7 +15,7 @@ // Add event listener for keydown events document.addEventListener('keydown', function(event) { - if (event.altKey && (event.key === 'l' || event.key === 'r' || event.key === 'v')) { + if ((event.altKey || event.metaKey) && (event.key === 'l' || event.key === 'r' || event.key === 'v')) { // Get the current URL const url = window.location.href; const pattern = /https:\/\/(?:www\.)?yr\.no\/([a-z]{2,3})\/(.+)\/([0-9-]+)\//;