Skip to content

Instantly share code, notes, and snippets.

@soundstep
Created April 2, 2020 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soundstep/8ee974a28e9834c94fb9829ba38a8a5e to your computer and use it in GitHub Desktop.
Save soundstep/8ee974a28e9834c94fb9829ba38a8a5e to your computer and use it in GitHub Desktop.
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