🎉 Initial Commit
This commit is contained in:
6
hello.html
Normal file
6
hello.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h1>Hello Extensions</h1>
|
||||||
|
<script src="popup.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
17
manifest.json
Normal file
17
manifest.json
Normal 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/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
49
scripts/content.js
Normal file
49
scripts/content.js
Normal 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;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user