Created
November 18, 2022 17:45
-
-
Save Yoshyn/dc6fee697f67d753c336d8ece0d4e410 to your computer and use it in GitHub Desktop.
Tampermonkey scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AWS SSO : Auto-allow | |
// @namespace https://skillsoftsso.awsapps.com/ | |
// @version 0.1 | |
// @description Auto allow | |
// @author You | |
// @match https://skillsoftsso.awsapps.com/start/user-consent/authorize.html?clientId=* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log(`AWS SSO : Auto-allow loaded !`); | |
if (document.body.innerHTML.search("Authorize request") !== -1) { | |
console.log(`Authorize request found !`); | |
let button = document.getElementById('cli_login_button'); | |
if (button.innerHTML.search("Allow") !== -1) { | |
console.log(`Button found !`); | |
button.click(); | |
} | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AWS SSO : Autoclose approved request | |
// @namespace https://skillsoftsso.awsapps.com/ | |
// @version 0.1 | |
// @description Autoclose aws sso approved request | |
// @author You | |
// @match https://skillsoftsso.awsapps.com/start/user-consent/login-success.html | |
// @grant window.close | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function sleep (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
if (document.body.innerHTML.search("Request approved") !== -1) { | |
console.log(`Waiting 1 seconds before close...`); | |
let target = document.getElementsByClassName('awsui-signin-message')[0]; | |
let theKid = document.createElement("h2"); | |
theKid.innerHTML = 'Windows will auto close in 1 second'; | |
target.appendChild(theKid); | |
sleep(1000).then(() => { | |
window.close(); | |
}); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AWS SSO : Reload expired | |
// @namespace https://skillsoftsso.awsapps.com/ | |
// @version 0.1 | |
// @description Reload exprired | |
// @author You | |
// @match https://*.signin.aws.amazon.com/oauth?* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function reloadFct() { | |
window.popup.close(); | |
location.reload(); | |
} | |
console.log('AWS SSO : Reload expired scripts'); | |
if (document.body.innerHTML.search("Your session has expired. To start a new session, click the link provided by your administrator:") !== -1) { | |
let href = document.getElementById('content').getElementsByTagName('a')[0].href; | |
console.log(`href = ${href}`) | |
window.popup = window.open(href, 'importwindow', 'width=500, height=200, top=100, left=200, toolbar=1'); | |
setTimeout(reloadFct, 5000); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redirect twitter to nitter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Redirect twitter to nitter | |
// @author You | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== | |
console.log('Redirect to Nitter !'); | |
location = Object.assign(new URL(location), { protocol: 'https:', host: 'nitter.42l.fr' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment