Skip to content

Instantly share code, notes, and snippets.

@mike-seger
Last active June 23, 2025 19:35
Show Gist options
  • Select an option

  • Save mike-seger/40c217fa419b7443cfcc7033e6ee4d3c to your computer and use it in GitHub Desktop.

Select an option

Save mike-seger/40c217fa419b7443cfcc7033e6ee4d3c to your computer and use it in GitHub Desktop.
selenium
Subject Important: Make a purchase to continue with your account
From Microsoft
To ....
Date 2025-06-10 08:22
Microsoft
Your account will be deleted by August 9, 2025—make a purchase to keep your billing account
===========================================================================================
You’re receiving this email because your Microsoft billing account ID ... and associated Microsoft Entra ID tenant (tenant ID ...) have been inactive for more than 200 days.
To continue using your current billing account and tenant, make a purchase before August 9, 2025. If you don’t make a purchase before this date, your next purchase with Microsoft will require a new billing account and an associated Microsoft Entra ID tenant to continue using Microsoft services.
Make a purchase >>
https://portal.azure.com/
Read the Microsoft data retention policy.
https://www.microsoft.com/trust-center/privacy/data-management#office-ContentAreaHeadingTemplate-gr75fdf
If you need help, create a support request.
https://portal.azure.com/#bladeMicrosoft_Azure_Support/HelpAndSupportBlade/newsupportrequest
Account information
-------------------
Billing account ID: ...
Tenant ID: ...
--------------------------------------------------
Privacy Statement: https://go.microsoft.com/fwlink/?LinkId=521839
Microsoft Corporation, One Microsoft Way, Redmond, WA 98052
Microsoft
// Replace this with the JSON you copied from chrome://policy
const policyJson = {
// EXAMPLE START
"ExtensionInstallBlacklist": {
"level": "mandatory",
"scope": "machine",
"source": "platform",
"value": ["*"]
},
"DeveloperToolsAvailability": {
"value": 2
},
"ExtensionInstallSources": {
"value": ["https://chrome.google.com/*"]
}
// EXAMPLE END
};
// Policy evaluation
const policies = {
ExtensionInstallBlacklist: {
description: "Blocks all extensions not explicitly whitelisted",
problemIf: (v) => v.includes("*")
},
ExtensionInstallWhitelist: {
description: "Only these extensions are allowed",
problemIf: (v) => v.length > 0
},
DeveloperToolsAvailability: {
description: "Controls access to DevTools (2 = disabled)",
problemIf: (v) => v === 2
},
ExtensionAllowedTypes: {
description: "Restricts extension types (e.g. disallows unpacked)",
problemIf: (v) => !v.includes("extension")
},
ExtensionInstallSources: {
description: "Restricts allowed install sources",
problemIf: (v) => !v.includes("file://") && !v.includes("*")
}
};
console.log("🔍 Chrome Policy Audit\n----------------------");
for (const [key, rule] of Object.entries(policies)) {
if (key in policyJson) {
const val = policyJson[key].value;
const hasIssue = rule.problemIf(val);
console.log(
`${hasIssue ? "❌" : "✅"} ${key} — ${rule.description}\n Value: ${JSON.stringify(val)}`
);
} else {
console.log(`ℹ️ ${key} not present`);
}
}
public static String snakeToTitleCase(String input) {
return Arrays.stream(input.toLowerCase().split("_"))
.filter(word -> !word.isEmpty())
.map(word -> Character.toUpperCase(word.charAt(0)) + word.substring(1))
.collect(Collectors.joining(" "));
}
By rowSelector = By.cssSelector(".ag-center-cols-container .ag-row"); // adjust if needed
WebElement viewport = driver.findElement(By.cssSelector(".ag-body-viewport")); // scrollable container
JavascriptExecutor js = (JavascriptExecutor) driver;
int previousCount = 0;
int maxRetries = 30; // safety limit
for (int i = 0; i < maxRetries; i++) {
// Scroll to bottom
js.executeScript("arguments[0].scrollTop = arguments[0].scrollHeight", viewport);
// Wait until new rows appear
boolean newRowsLoaded = new WebDriverWait(driver, Duration.ofSeconds(5)).until(driver1 -> {
List<WebElement> rows = driver1.findElements(rowSelector);
return rows.size() > previousCount;
});
// Update count
List<WebElement> currentRows = driver.findElements(rowSelector);
int currentCount = currentRows.size();
if (!newRowsLoaded || currentCount == previousCount) {
break; // No more new rows => done
}
previousCount = currentCount;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment