Skip to content

Commit

Permalink
Made yr script more mac compatible... hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Aug 21, 2024
1 parent 32eb832 commit c3054d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yr.user.js
Original file line number Diff line number Diff line change
@@ -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/*
Expand All @@ -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-]+)\//;
Expand Down

0 comments on commit c3054d1

Please sign in to comment.