Is it possible to get the sources page?

Want to get all attached js and css files to the page. Can it be done?
If Yes - by what?
I need to get all attached files to the page and then display its code.
By the way, I need(!) to use frames, so it is advisable to have captured a file with all html pages
March 19th 20 at 09:28
2 answers
March 19th 20 at 09:30
<!DOCTYPE html>
<html lang="en">
the <head>
 <meta charset="UTF-8" />

 <link rel="stylesheet" href="/src/" />
 <script src="src/"></script>
the <body>
 <div id="nest"></div>

 <link rel="stylesheet" href="/src/" />
 <script src="src/"></script>

the <script>
 const nest = document.querySelector("#nest");
 const elems = document.querySelectorAll('link[rel="stylesheet"], script[src]');

 elems.forEach(el => {
 fetch(el.src || el.href)
 .then(r => r.text())
 .then(src => {
 const pre = document.createElement("pre");
 const hr = document.createElement("hr");

 pre.innerText = src;

a link to the document from the iframe you can get this:
const myIframeDocument = document.querySelector('iframe').contentDocument;

myIframeDocument.querySelectorAll('link[rel="stylesheet"], script[src]');
//well, then the same thing...

only if iframe on different domain, then it will be lock request due to a cors'
March 19th 20 at 09:32
and then parse the link[href], script[src] and iframe[src]

Find more questions by tags HTML