How can using chrome extension get the source code of the frame as it is without having to modify the scripts afterwards? I tried this:

chrome.webNavigation.onDOMContentLoaded.addListener(d => { chrome.tabs.executeScript(d.tabId, { code: ` if(window.top != window.self) chrome.runtime.sendMessage(chrome.runtime.id, { message: 'html', data: document.documentElement.outerHTML } ); `, frameId: d.frameId }); }); 

Does not work (all the same, scripts have time to modify). With Ajax, you can't do it, because there may be different content on the same url (dynamic frame).

    1 answer 1

    Normal means (chrome.webRequest) in any way.

    You can try very heavy artillery - chrome.debugger API .

    In short: Attach to the page (Chrome will show a yellow warning at the top), and then send the getResponseBody command.