From 4ddb0024d0b044966d46b05ad354c2661676fc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Mon, 24 Feb 2025 14:14:57 +0100 Subject: [PATCH] Added PIM hotkey script --- m365-admin.user.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 m365-admin.user.js diff --git a/m365-admin.user.js b/m365-admin.user.js new file mode 100644 index 0000000..dbfb02b --- /dev/null +++ b/m365-admin.user.js @@ -0,0 +1,25 @@ +// ==UserScript== +// @name M365 Admin - PIM Activate Hotkey +// @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic +// @version 1.0.0 +// @description `Ctrl` + `Enter` to Activate PIM role instead of having to manually click the `Activate` button. +// @author Øyvind Nilsen (on@ntnu.no) +// @match https://portal.azure.com/?feature.msaljs=true#view/Microsoft_Azure_PIMCommon/ActivationMenuBlade/* +// @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com +// @grant none +// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js +// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js +// ==/UserScript== + +(function() { + 'use strict'; + + document.addEventListener('keydown', function(e) { + if (e.ctrlKey && e.key === 'Enter') { + var button_container = document.querySelector('div[data-formelement="pcControl: saveButton"]'); + if (button_container) { + button_container.childNodes[0].click(); + } + } + }); +})(); \ No newline at end of file