Created
April 2, 2020 11:55
-
-
Save soundstep/8ee974a28e9834c94fb9829ba38a8a5e to your computer and use it in GitHub Desktop.
Tampermonkey script to retrieve hades files (js and css)
This file contains 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 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