Fix USO install button

Narcolepticinsomniac worked out the code
This commit is contained in:
Rob Garrison 2019-03-24 18:08:01 -05:00
parent 9c8970309d
commit dd20acd784

View File

@ -456,3 +456,15 @@ if (location.search.includes('category=')) {
}).observe(document, {childList: true, subtree: true}); }).observe(document, {childList: true, subtree: true});
}); });
} }
if (/^https?:\/\/userstyles\.org\/styles\/\d{3,}/.test(location.href)) {
new MutationObserver((_, observer) => {
const cssButton = document.getElementsByClassName('css_button');
if (cssButton.length) {
// Click on the "Show CSS Code" button to workaround the JS error
cssButton[0].click();
cssButton[0].click();
observer.disconnect();
}
}).observe(document, {childList: true, subtree: true});
}