🎉 Initial Commit

This commit is contained in:
2025-03-31 23:43:22 +02:00
commit d300a2a665
6 changed files with 73 additions and 0 deletions

BIN
128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

6
hello.html Normal file
View File

@@ -0,0 +1,6 @@
<html>
<body>
<h1>Hello Extensions</h1>
<script src="popup.js"></script>
</body>
</html>

BIN
hello.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

17
manifest.json Normal file
View File

@@ -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/*"
]
}
]
}

1
popup.js Normal file
View File

@@ -0,0 +1 @@
console.log("This is a popup!")

49
scripts/content.js Normal file
View File

@@ -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;
}
})
});
}
});
}
});
}
});
}
});
}
});
}
}