Skip to content

Instantly share code, notes, and snippets.

@rogerhutchings
Created July 25, 2024 08:54
Show Gist options
  • Save rogerhutchings/08e4c653e57034a8670364afb93e77e5 to your computer and use it in GitHub Desktop.
Save rogerhutchings/08e4c653e57034a8670364afb93e77e5 to your computer and use it in GitHub Desktop.
TamperMonkey script for WM
// ==UserScript==
// @name WM modal no more
// @namespace http://tampermonkey.net/
// @version 2024-07-25
// @description try to take over the world!
// @author You
// @match https://support.walkme.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
waitForElement('.loginsupportModal').then(() => {
const jQuery = window.jQuery;
jQuery('.loginsupportModal, .login-overlay').hide();
jQuery('.mainContent').removeClass('modalOpen');
jQuery('body').removeClass('noscroll');
jQuery(".loginWrap").hide();
});
function waitForElement(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
observer.disconnect();
resolve(document.querySelector(selector));
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment