commit d300a2a665fc22f792e9163bee7df26eb9eda228 Author: k3y0708 Date: Mon Mar 31 23:43:22 2025 +0200 🎉 Initial Commit diff --git a/128.png b/128.png new file mode 100644 index 0000000..d2e8f1c Binary files /dev/null and b/128.png differ diff --git a/hello.html b/hello.html new file mode 100644 index 0000000..8792b8e --- /dev/null +++ b/hello.html @@ -0,0 +1,6 @@ + + +

Hello Extensions

+ + + diff --git a/hello.png b/hello.png new file mode 100644 index 0000000..6ae26d1 Binary files /dev/null and b/hello.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..2e5a881 --- /dev/null +++ b/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 3, + "name": "Azure Portal Enhancements", + "description": "Enhancements to the Azure Portal", + "version": "0.1", + "icons": { + "128": "128.png" + }, + "content_scripts": [ + { + "js": ["scripts/content.js"], + "matches": [ + "https://portal.azure.com/*" + ] + } + ] +} diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..c1d3a15 --- /dev/null +++ b/popup.js @@ -0,0 +1 @@ +console.log("This is a popup!") diff --git a/scripts/content.js b/scripts/content.js new file mode 100644 index 0000000..9bb5f0b --- /dev/null +++ b/scripts/content.js @@ -0,0 +1,49 @@ +// Wait until the page is fully loaded +window.onload = function() { + // Sleep for 5 seconds + setTimeout(() => { + // Call the function to click the correct dropdown + clickCorrectDropdown(); + }, 5000); +} + +function clickCorrectDropdown() { + + alert("Page loaded"); + + const divs = document.querySelector("div.azc-validationBelowCtrl"); + + if (divs) { + // correct div contains in data-bind: "pcControl: groupByDropdown" + const correctDiv = Array.from(divs).find(div => div.getAttribute("data-bind").contains("groupByDropdown")); + correctDiv.click() + correctDiv.children().forEach(child => { + if (child.classList.contains("azc-formElementSubLabelContainer")) { + child.children().forEach(subChild => { + if (child.classList.contains("azc-formElementContainer")) { + subchild.children().forEach(subSubChild => { + if (subSubChild.classList.contains("fxc-dropdown-popup")) { + subSubChild.children().forEach(subSubSubChild => { + if (subSubSubChild.getAttribute("aria-label") === "List of options") { + subSubSubChild.children().forEach(subSubSubSubChild => { + if (subSubSubSubChild.classList.contains("fxc-inner-popup")) { + subSubSubSubChild.children().forEach(option => { + option.children().forEach(optionChild => { + if (optionChild.innerHTML.contains("Group by type")) { + optionChild.click(); + return; + } + }) + }); + } + }); + } + }); + } + }); + } + }); + } + }); + } +}