Skip to content

Commit 381b54f

Browse files
committed
Support global SSO banner
1 parent 87d14cb commit 381b54f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/userscripts/github-auto-sso/index.user.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ import { defineUserScript } from "bundlemonkey";
22

33
export default defineUserScript({
44
name: "GitHub - Auto SSO",
5-
version: "1.1.1",
5+
version: "1.2.0",
66
description: "Attempt SSO if the banner exists on every pageload",
77
match: ["https://github.com/*"],
88
icon: "https://www.google.com/s2/favicons?domain=github.com",
99
main: () => {
10+
const globalSSOBannerSection = document.querySelector(
11+
"[data-testid='global-sso-banner']",
12+
);
13+
const ssoBannerActionAnchor = globalSSOBannerSection?.querySelector(
14+
"[class*='-Banner-BannerActionsContainer-'] a",
15+
);
16+
if (ssoBannerActionAnchor instanceof HTMLElement) {
17+
ssoBannerActionAnchor.click();
18+
return;
19+
}
20+
1021
const ssoFormSubmitButton = document.querySelector(
1122
".business-sso-panel form button[type='submit']",
1223
);

0 commit comments

Comments
 (0)