Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tampermonkey script to retrieve hades files (js and css)
// ==UserScript==
// @name Extract Hades files
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include http*://*hades*
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log('- retrieving Hades javascript files -');
const scripts = Array.from(document.querySelectorAll('script'))
.map((scriptElement) => {
const src = scriptElement.getAttribute('src');
if (src && src.indexOf('_next') !== -1) {
return `${location.origin}${src}`;
}
})
.filter(Boolean);
const links = Array.from(document.querySelectorAll('link'))
.map((linkElement) => {
const rel = linkElement.getAttribute('rel');
const href = linkElement.getAttribute('href');
if (rel === 'stylesheet') {
return `${location.origin}${href}`;
}
})
.filter(Boolean);
console.log(scripts.concat(links).join('\n'));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment