-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserscript.js
52 lines (47 loc) · 2.21 KB
/
userscript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ==UserScript==
// @name IDaaSログイン制御
// @namespace http://tampermonkey.net/
// @version 0.4
// @description try to take over the world!
// @author You
// @match https://id.moneyforward.com/*
// @match https://enterprise-accounting.moneyforward.com/session/new
// @match https://app.asana.com/*
// @match https://esa.io/
// @grant none
// @updateURL https://raw.githubusercontent.com/karakuri-ai/IDaaS_userscript/main/userscript.js
// @downloadURL https://raw.githubusercontent.com/karakuri-ai/IDaaS_userscript/main/userscript.js
// ==/UserScript==
(function() {
'use strict';
const path = location.pathname;
const url = location.href;
if (path == "/account_selector") {
const otherAccount = document.getElementsByClassName("m2Hwu1pT mainNavigationLink _2aYDBMl2 bizDomain")[0];
console.log(otherAccount);
otherAccount.click();
}
if (path == "/sign_in/new") {
console.log(document.getElementsByClassName("_2YH0UDm8 ssoLink").item(0));
if (typeof(document.getElementsByClassName("_2YH0UDm8 ssoLink")[0]) === "undefined") {location.reload();}
const loginByEmail = document.getElementsByClassName("_2YH0UDm8 ssoLink").item(0);
console.log(loginByEmail);
loginByEmail.click();
}
if (url == "https://enterprise-accounting.moneyforward.com/session/new") {
const login_with_id = document.getElementsByClassName("ca-btn-save ca-btn-login ca-btn-size-medium").item(0);
login_with_id.click();
}
if(url == 'https://esa.io/') {
console.log(url);
const loginbtn = document.getElementsByClassName("btn btn-skeleton lp-navbar__sign-in pull-right")[0];
console.log(loginbtn);
loginbtn.click();
}
if(url == 'https://app.asana.com/-/login') {
console.log(url);
const loginbtn = document.getElementsByClassName("AbstractThemeableRectangularButton--isEnabled AbstractThemeableRectangularButton AbstractThemeableRectangularButton--large SecondaryButton GoogleSignInButton--sparse GoogleSignInButton LoginContent-ssoButton LoginContent-ssoButton--reskin")[0];
console.log(loginbtn);
loginbtn.click();
}
})();;